Skip to content

Commit

Permalink
never log in to logout page
Browse files Browse the repository at this point in the history
  • Loading branch information
theosanderson authored Feb 28, 2024
1 parent e7f2d9b commit 7ecb315
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions website/src/middleware/authMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import jsonwebtoken from 'jsonwebtoken';
import JwksRsa from 'jwks-rsa';
import { err, ok, ResultAsync } from 'neverthrow';
import { type BaseClient, Issuer, type TokenSet } from 'openid-client';

Check failure on line 6 in website/src/middleware/authMiddleware.ts

View workflow job for this annotation

GitHub Actions / Check format and types

There should be at least one empty line between import groups
import {routes} from "../routes"

Check failure on line 7 in website/src/middleware/authMiddleware.ts

View workflow job for this annotation

GitHub Actions / Check format and types

There should be no empty line within import group

Check failure on line 7 in website/src/middleware/authMiddleware.ts

View workflow job for this annotation

GitHub Actions / Check format and types

`../routes` import should occur after import of `../logger.ts`

import { getConfiguredOrganisms, getRuntimeConfig } from '../config.ts';
import { getInstanceLogger } from '../logger.ts';
Expand Down Expand Up @@ -47,6 +48,10 @@ export async function getKeycloakClient() {
}

export const getAuthUrl = async (redirectUrl: string) => {
const logout = routes.logout()
if(redirectUrl.endsWith(logout)){
redirectUrl = redirectUrl.replace(logout, routes.userOverviewPage())
}
const authUrl = (await getKeycloakClient()).authorizationUrl({
redirect_uri: redirectUrl,
scope: 'openid',
Expand Down

0 comments on commit 7ecb315

Please sign in to comment.