Skip to content

Commit

Permalink
fix: issue when there are multiple accountid query params. (#103)
Browse files Browse the repository at this point in the history
* 24755 - fix: when and how is account fetched.

* fix: issue when there are multiple accountid query params.

* fix: eslint

* fix: issue when there are multiple accountid query params.
  • Loading branch information
hfekete authored Dec 6, 2024
1 parent ca81517 commit cf93a52
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/middleware/02.setupAuth.global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ export default defineNuxtRouteMiddleware(async (to) => {
// keycloak redirects with the error param when not logged in (nuxt/keycloak issue)
// - removing ^ condition will cause an infinite loop of keycloak redirects when not authenticated
const { kcURL, kcRealm, kcClient } = useRuntimeConfig().public
let accountNumber = to?.params?.accountid || to?.query?.accountid || undefined
if (Array.isArray(accountNumber)) {
accountNumber = accountNumber[0]
}
await useBcrosAuth().setupAuth(
{ url: kcURL, realm: kcRealm, clientId: kcClient },
to.params.accountid as string || to.query.accountid as string
accountNumber
)
}
// For cypress tests. NOTE: all api calls will need to be intercepted/stubbed
Expand Down

0 comments on commit cf93a52

Please sign in to comment.