mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 03:41:01 +00:00
Fix login via navbar (#3962)
This commit is contained in:
parent
1c7c87b8f0
commit
9948163e6e
2 changed files with 2 additions and 6 deletions
|
@ -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>
|
||||
|
@ -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>
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue