mirror of
https://github.com/penpot/penpot.git
synced 2025-06-05 17:11:40 +02:00
♻️ Refactor invitation flow
Enfoces security and make the flow more deterministic.
This commit is contained in:
parent
6486b24c8b
commit
96facc5100
7 changed files with 117 additions and 156 deletions
|
@ -41,13 +41,15 @@
|
|||
[tdata]
|
||||
(case (:state tdata)
|
||||
:created
|
||||
(st/emit! (dm/success (tr "auth.notifications.team-invitation-accepted"))
|
||||
(du/fetch-profile)
|
||||
(rt/nav :dashboard-projects {:team-id (:team-id tdata)}))
|
||||
(st/emit!
|
||||
(dm/success (tr "auth.notifications.team-invitation-accepted"))
|
||||
(du/fetch-profile)
|
||||
(rt/nav :dashboard-projects {:team-id (:team-id tdata)}))
|
||||
|
||||
:pending
|
||||
(let [token (:invitation-token tdata)]
|
||||
(st/emit! (rt/nav :auth-register {} {:invitation-token token})))))
|
||||
(let [token (:invitation-token tdata)
|
||||
route-id (:redirect-to tdata :auth-register)]
|
||||
(st/emit! (rt/nav route-id {} {:invitation-token token})))))
|
||||
|
||||
(defmethod handle-token :default
|
||||
[_tdata]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue