Skip to content

Commit 2f8b87f

Browse files
Laurie T. Malauroboquat
Laurie T. Malau
authored andcommitted
[server] Redirect without hitting sorry endpoint.
Fixes #5183
1 parent 541beb0 commit 2f8b87f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/server/src/auth/generic-auth-provider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,11 @@ export class GenericAuthProvider implements AuthProvider {
356356
message = 'OAuth Error. Please try again.'; // this is a 5xx response from authorization service
357357
}
358358

359-
if (!UnconfirmedUserException.is(err)) {
360-
// user did not accept ToS. Don't count this towards the error burn rate.
361-
increaseLoginCounter("failed", this.host);
359+
if (UnconfirmedUserException.is(err)) {
360+
return this.sendCompletionRedirectWithError(response, { error: err.message });
362361
}
363362

363+
increaseLoginCounter("failed", this.host);
364364
log.error(context, `(${strategyName}) Redirect to /sorry from verify callback`, err, { ...defaultLogPayload, err });
365365
response.redirect(this.getSorryUrl(message));
366366
return;

0 commit comments

Comments
 (0)