Commit a8812bd
fix(email): throw when authenticated user has no email or wrong email
The previous condition only checked for a mismatch when the user had a
non-empty email address. Users without an email (e.g. the admin) would
silently pass through, letting the page load with nodeId: 0 and
showing the generic "Document not found" error.
Invert the guard: allow only when email matches, otherwise throw with
a clear message asking the user to log out.
Also improves the error message from the generic "Invalid user" to
"This document is not yours. Log out and use the sign link again."
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>1 parent 83b60c6 commit a8812bd
1 file changed
Lines changed: 9 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 133 | + | |
| 134 | + | |
141 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
0 commit comments