Fixed: Return error when Slack auth fails to help with debugging
This commit is contained in:
parent
a7d49e9042
commit
f80c3c6877
@ -29,8 +29,12 @@ router.get('slack.callback', auth({ required: false }), async ctx => {
|
||||
ctx.assertPresent(code || error, 'code is required');
|
||||
ctx.assertPresent(state, 'state is required');
|
||||
|
||||
if (state !== ctx.cookies.get('state') || error) {
|
||||
ctx.redirect(`/?notice=auth-error`);
|
||||
if (state !== ctx.cookies.get('state')) {
|
||||
ctx.redirect('/?notice=auth-error');
|
||||
return;
|
||||
}
|
||||
if (error) {
|
||||
ctx.redirect(`/?notice=auth-error&error=${error}`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user