Skip to content

Commit

Permalink
chore: Revert "chore: ignore jwt if not access controlled"
Browse files Browse the repository at this point in the history
This reverts commit 7abfd32.
  • Loading branch information
tripodsan committed Jul 10, 2023
1 parent 7abfd32 commit eb52f11
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/steps/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ export function isAllowed(email = '', allows = []) {
* @returns {Promise<void>}
*/
export async function authenticate(state, req, res) {
// get auth info
const authInfo = await getAuthInfo(state, req);

// check if `.auth` route to validate and exchange token
if (state.info.path === '/.auth') {
const authInfo = await getAuthInfo(state, req);
await authInfo.exchangeToken(state, req, res);
return;
}
Expand All @@ -48,9 +50,6 @@ export async function authenticate(state, req, res) {
return;
}

// get auth info
const authInfo = await getAuthInfo(state, req);

// if not authenticated, redirect to login screen
if (!authInfo.authenticated) {
// send 401 for plain requests
Expand Down

0 comments on commit eb52f11

Please sign in to comment.