diff --git a/blog_exceptions.py b/blog_exceptions.py index cc5672ea..e78b3cef 100644 --- a/blog_exceptions.py +++ b/blog_exceptions.py @@ -93,6 +93,11 @@ class PasswordsDoNotMatchError(ValueError): pass +class WeakPasswordError(ValueError): + """Raised when password does not meet strength requirements (length, uppercase, lowercase, special char).""" + pass + + class CommentEmptyError(ValueError): """Raised when comment content is empty.""" pass diff --git a/flask_setup/__init__.py b/flask_setup/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/frontend/core/components/ArticleForm.jsx b/frontend/core/components/ArticleForm.jsx index 1ae1c80c..65791902 100644 --- a/frontend/core/components/ArticleForm.jsx +++ b/frontend/core/components/ArticleForm.jsx @@ -395,6 +395,8 @@ export default function ArticleForm() { if (res.ok) { const data = await res.json(); window.location.href = `/articles/${data.id || articleId}`; + } else if (res.status === 401) { + window.location.href = '/'; } else { const err = await res.json(); setError(err.error || _('Failed to save.')); @@ -435,7 +437,7 @@ export default function ArticleForm() { {_('Description')}