mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 15:58:38 +01:00
add email login
This commit is contained in:
31
dashboard/pages/jwt_login.vue
Normal file
31
dashboard/pages/jwt_login.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
definePageMeta({ layout: 'none' });
|
||||
|
||||
const route = useRoute();
|
||||
const jwtLogin = computed(() => route.query.jwt_login as string);
|
||||
const { token, setToken } = useAccessToken();
|
||||
|
||||
onMounted(async () => {
|
||||
|
||||
if (jwtLogin.value) {
|
||||
setToken(jwtLogin.value);
|
||||
const user = await $fetch<any>('/api/user/me', { headers: { 'Authorization': 'Bearer ' + token.value } })
|
||||
const loggedUser = useLoggedUser();
|
||||
loggedUser.user = user;
|
||||
setTimeout(() => { location.href = '/project_creation?just_logged=true' }, 100);
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<template>
|
||||
<div> You will be redirected soon </div>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
Reference in New Issue
Block a user