mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-06-24 08:10:47 +00:00
18 lines
415 B
TypeScript
18 lines
415 B
TypeScript
import useConfig from '~/compositions/useConfig';
|
|
import useUserConfig from '~/compositions/useUserConfig';
|
|
|
|
export default () =>
|
|
({
|
|
isAuthenticated: !!useConfig().user,
|
|
|
|
user: useConfig().user,
|
|
|
|
authenticate(url?: string) {
|
|
if (url) {
|
|
const config = useUserConfig();
|
|
config.setUserConfig('redirectUrl', url);
|
|
}
|
|
window.location.href = '/login';
|
|
},
|
|
} as const);
|