Add folders with password sharing and email invites

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-06 22:30:00 +03:00
parent a375ad330a
commit db2cef41bb
16 changed files with 1016 additions and 4 deletions
+7
View File
@@ -2,6 +2,7 @@ from flask import Blueprint, flash, redirect, render_template, request, url_for
from flask_login import current_user, login_user, logout_user
from app import db
from app.folder_utils import process_pending_invites
from app.models import User
bp = Blueprint("auth", __name__, url_prefix="/auth")
@@ -34,7 +35,10 @@ def register():
db.session.add(user)
db.session.commit()
login_user(user)
accepted = process_pending_invites(user)
flash("Регистрация успешна. Добро пожаловать!", "success")
if accepted:
flash(f"Вам открыт доступ к {accepted} общим папкам", "success")
return redirect(url_for("cabinet.index"))
return render_template("auth/register.html")
@@ -60,7 +64,10 @@ def login():
flash("Аккаунт заблокирован", "error")
else:
login_user(user, remember=remember)
accepted = process_pending_invites(user)
flash(f"Добро пожаловать, {user.username}!", "success")
if accepted:
flash(f"Вам открыт доступ к {accepted} общим папкам", "success")
next_page = request.args.get("next")
if next_page:
return redirect(next_page)