feat: (auth) switch to OTP code via e-mail
All checks were successful
Build BAB Application Deployment Artifact / build (push) Successful in 2m24s
All checks were successful
Build BAB Application Deployment Artifact / build (push) Successful in 2m24s
This commit is contained in:
@@ -45,22 +45,31 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
await init();
|
||||
}
|
||||
|
||||
async function createTokenSession(email: string) {
|
||||
return await account.createEmailToken(ID.unique(), email);
|
||||
}
|
||||
|
||||
async function googleLogin() {
|
||||
account.createOAuth2Session(
|
||||
await account.createOAuth2Session(
|
||||
OAuthProvider.Google,
|
||||
'https://oys.undock.ca',
|
||||
'https://oys.undock.ca/login'
|
||||
);
|
||||
currentUser.value = await account.get();
|
||||
await init();
|
||||
}
|
||||
|
||||
async function discordLogin() {
|
||||
account.createOAuth2Session(
|
||||
await account.createOAuth2Session(
|
||||
OAuthProvider.Discord,
|
||||
'https://oys.undock.ca',
|
||||
'https://oys.undock.ca/login'
|
||||
);
|
||||
currentUser.value = await account.get();
|
||||
await init();
|
||||
}
|
||||
|
||||
async function tokenLogin(userId: string, token: string) {
|
||||
await account.createSession(userId, token);
|
||||
await init();
|
||||
}
|
||||
|
||||
function getUserNameById(id: string | undefined | null): string {
|
||||
@@ -102,6 +111,8 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
login,
|
||||
googleLogin,
|
||||
discordLogin,
|
||||
createTokenSession,
|
||||
tokenLogin,
|
||||
logout,
|
||||
init,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user