Skip to content

Commit

Permalink
Fix login via navbar (#3962)
Browse files Browse the repository at this point in the history
  • Loading branch information
anbraten authored and 6543 committed Jul 23, 2024
1 parent 805c315 commit 7ab9aaf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions web/src/components/layout/header/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<IconButton v-if="user" :to="{ name: 'user' }" :title="$t('user.settings.settings')" class="navbar-icon !p-1.5">
<img v-if="user && user.avatar_url" class="rounded-md" :src="`${user.avatar_url}`" />
</IconButton>
<Button v-else :text="$t('login')" @click="doLogin" />
<Button v-else :text="$t('login')" :to="`/login?url=${route.fullPath}`" />
</div>
</nav>
</template>
Expand All @@ -55,10 +55,6 @@ const authentication = useAuthentication();
const { user } = authentication;
const apiUrl = `${config.rootPath ?? ''}/swagger/index.html`;
function doLogin() {
authentication.authenticate(route.fullPath);
}
const { enableSwagger } = config;
</script>

Expand Down
2 changes: 1 addition & 1 deletion web/src/compositions/useAuthentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ export default () =>
const config = useUserConfig();
config.setUserConfig('redirectUrl', url);
}
window.location.href = `${useConfig().rootPath}/authorize?forge_id=${forgeId}`;
window.location.href = `${useConfig().rootPath}/authorize?${forgeId !== undefined ? `forgeId=${forgeId}` : ''}`;
},
}) as const;

0 comments on commit 7ab9aaf

Please sign in to comment.