Skip to content

Commit

Permalink
mailbox page requires sudo (#2094)
Browse files Browse the repository at this point in the history
Co-authored-by: Son NK <son@simplelogin.io>
  • Loading branch information
nguyenkims and Son NK committed Apr 23, 2024
1 parent ee0be36 commit 037bc9d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/dashboard/views/mailbox_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
from app.config import ENFORCE_SPF, MAILBOX_SECRET
from app.config import URL
from app.dashboard.base import dashboard_bp
from app.dashboard.views.enter_sudo import sudo_required
from app.db import Session
from app.email_utils import email_can_be_used_as_mailbox
from app.email_utils import mailbox_already_used, render, send_email
from app.extensions import limiter
from app.log import LOG
from app.models import Alias, AuthorizedAddress
from app.models import Mailbox
Expand All @@ -29,6 +31,8 @@ class ChangeEmailForm(FlaskForm):

@dashboard_bp.route("/mailbox/<int:mailbox_id>/", methods=["GET", "POST"])
@login_required
@sudo_required
@limiter.limit("20/minute", methods=["POST"])
def mailbox_detail_route(mailbox_id):
mailbox: Mailbox = Mailbox.get(mailbox_id)
if not mailbox or mailbox.user_id != current_user.id:
Expand Down

0 comments on commit 037bc9d

Please sign in to comment.