0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-13 02:28:18 -05:00

🐛 Fix invitation link validation issue

This commit is contained in:
Andrey Antukh 2022-12-17 13:40:29 +01:00
parent c13730dca7
commit 3496463a79

View file

@ -632,10 +632,10 @@
update set role = ?, updated_at = now();")
(defn- create-invitation-token
[cfg {:keys [expire profile-id team-id member-id member-email role]}]
[cfg {:keys [valid-until profile-id team-id member-id member-email role]}]
(tokens/generate (::main/props cfg)
{:iss :team-invitation
:exp expire
:exp valid-until
:profile-id profile-id
:role role
:team-id team-id
@ -654,7 +654,7 @@
(let [member (profile/retrieve-profile-data-by-email conn email)
expire (dt/in-future "168h") ;; 7 days
itoken (create-invitation-token cfg {:profile-id (:id profile)
:expire expire
:valid-until expire
:team-id (:id team)
:member-email (or (:email member) email)
:member-id (:id member)
@ -804,7 +804,7 @@
member (profile/retrieve-profile-data-by-email pool (:email invit))
token (create-invitation-token cfg {:team-id (:team-id invit)
:profile-id profile-id
:expire (:expire invit)
:valid-until (:valid-until invit)
:role (:role invit)
:member-id (:id member)
:member-email (or (:email member) (:email-to invit))})]