Commit a2607f1
fix: exempt recovery sessions from current password requirement
When updating a password via the recovery (password reset) flow,
the user cannot know their current password — that is the whole point
of the flow. This commit:
1. verifyPost: issues refresh tokens with models.Recovery auth method
for RecoveryVerification type, so the AMR claim is correctly stored
as "recovery" instead of "otp".
2. user.go: checks for the recovery AMR claim when
GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is enabled,
and skips the current-password check for recovery sessions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent a9edb4e commit a2607f1
2 files changed
+50
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
154 | 172 | | |
155 | 173 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
160 | 177 | | |
161 | | - | |
162 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
163 | 187 | | |
164 | 188 | | |
165 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
192 | 200 | | |
193 | 201 | | |
194 | 202 | | |
| |||
288 | 296 | | |
289 | 297 | | |
290 | 298 | | |
291 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
292 | 308 | | |
293 | 309 | | |
294 | 310 | | |
| |||
0 commit comments