Skip to content

Commit 7abfd32

Browse files
committed
chore: ignore jwt if not access controlled
1 parent 0a977dc commit 7abfd32

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/steps/authenticate.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ export function isAllowed(email = '', allows = []) {
3636
* @returns {Promise<void>}
3737
*/
3838
export async function authenticate(state, req, res) {
39-
// get auth info
40-
const authInfo = await getAuthInfo(state, req);
41-
4239
// check if `.auth` route to validate and exchange token
4340
if (state.info.path === '/.auth') {
41+
const authInfo = await getAuthInfo(state, req);
4442
await authInfo.exchangeToken(state, req, res);
4543
return;
4644
}
@@ -50,6 +48,9 @@ export async function authenticate(state, req, res) {
5048
return;
5149
}
5250

51+
// get auth info
52+
const authInfo = await getAuthInfo(state, req);
53+
5354
// if not authenticated, redirect to login screen
5455
if (!authInfo.authenticated) {
5556
// send 401 for plain requests

0 commit comments

Comments
 (0)