mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-22 18:01:02 +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">
|
<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}`" />
|
<img v-if="user && user.avatar_url" class="rounded-md" :src="`${user.avatar_url}`" />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Button v-else :text="$t('login')" @click="doLogin" />
|
<Button v-else :text="$t('login')" :to="`/login?url=${route.fullPath}`" />
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
|
@ -55,10 +55,6 @@ const authentication = useAuthentication();
|
||||||
const { user } = authentication;
|
const { user } = authentication;
|
||||||
const apiUrl = `${config.rootPath ?? ''}/swagger/index.html`;
|
const apiUrl = `${config.rootPath ?? ''}/swagger/index.html`;
|
||||||
|
|
||||||
function doLogin() {
|
|
||||||
authentication.authenticate(route.fullPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
const { enableSwagger } = config;
|
const { enableSwagger } = config;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,6 @@ export default () =>
|
||||||
const config = useUserConfig();
|
const config = useUserConfig();
|
||||||
config.setUserConfig('redirectUrl', url);
|
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;
|
}) as const;
|
||||||
|
|
Loading…
Reference in a new issue