Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
wkramer committed Dec 13, 2023
1 parent 95191e7 commit e4a53a2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,13 @@ const router = createRouter({

let routesAreInitialized = false

async function handleAuthorization(
to: RouteLocationNormalized,
) {
async function handleAuthorization(to: RouteLocationNormalized) {
const currentUser = await authenticationManager.userManager.getUser()
if (currentUser === null) {
return { name: 'Login', query: { redirect: to.redirectedFrom?.path ?? to.path } }
return {
name: 'Login',
query: { redirect: to.redirectedFrom?.path ?? to.path },
}
}
}

Expand Down Expand Up @@ -205,7 +206,7 @@ router.beforeEach(async (to, from) => {
try {
const user =
await authenticationManager.userManager.signinRedirectCallback()
if ( user.state ) redirect = user.state.toString()
if (user.state) redirect = user.state.toString()
} catch (error) {
console.error(error)
}
Expand All @@ -221,7 +222,7 @@ router.beforeEach(async (to, from) => {
routesAreInitialized = true
if (redirect) {
return redirect
} else if(to.path === '/about' && from.path === '/') {
} else if (to.path === '/about' && from.path === '/') {
return from
} else {
return to
Expand Down

0 comments on commit e4a53a2

Please sign in to comment.