Skip to content

Commit

Permalink
Encode invitee email in the invitation link (#10842)
Browse files Browse the repository at this point in the history
  • Loading branch information
nht1206 authored Nov 19, 2024
1 parent 2dc29cf commit 6f4885d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/controllers/console/workspace/members.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from urllib import parse

from flask_login import current_user
from flask_restful import Resource, abort, marshal_with, reqparse

Expand Down Expand Up @@ -57,11 +59,12 @@ def post(self):
token = RegisterService.invite_new_member(
inviter.current_tenant, invitee_email, interface_language, role=invitee_role, inviter=inviter
)
encoded_invitee_email = parse.quote(invitee_email)
invitation_results.append(
{
"status": "success",
"email": invitee_email,
"url": f"{console_web_url}/activate?email={invitee_email}&token={token}",
"url": f"{console_web_url}/activate?email={encoded_invitee_email}&token={token}",
}
)
except AccountAlreadyInTenantError:
Expand Down

0 comments on commit 6f4885d

Please sign in to comment.