Skip to content

Commit

Permalink
fix: multiple accountid in the query param (#101)
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
  • Loading branch information
hfekete authored Dec 6, 2024
1 parent cd2efc0 commit ca81517
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/middleware/02.setupAuth.global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export default defineNuxtRouteMiddleware(async (to) => {
// set account stuff (normally would happen after kc init in 'setupAuth')
const account = useBcrosAccount()
await account.setUserName()
const accountNumber = to?.params?.accountid || to?.query?.accountid || undefined
let accountNumber = to?.params?.accountid || to?.query?.accountid || undefined
if (Array.isArray(accountNumber)) {
accountNumber = accountNumber[0]
}
await account.setAccountInfo(+accountNumber)
}
})

0 comments on commit ca81517

Please sign in to comment.