fix: (auth) token login fix

This commit is contained in:
2024-06-15 00:05:41 -04:00
parent 643d74e29d
commit d063b0cf0d
2 changed files with 3 additions and 1 deletions

View File

@@ -118,6 +118,7 @@ async function login(email: string, password: string) {
});
appRouter.replace({ name: 'index' });
} catch (error: unknown) {
console.log(error);
if (error instanceof AppwriteException) {
if (error.type === 'user_session_already_exists') {
appRouter.replace({ name: 'index' });

View File

@@ -87,6 +87,7 @@ import { AppwriteException } from 'appwrite';
const email = ref('');
const token = ref('');
const userId = ref();
const router = useRouter();
console.log('version:' + process.env.VUE_APP_VERSION);
@@ -120,7 +121,7 @@ const doTokenLogin = async () => {
spinner: false,
icon: 'check_circle',
});
useRouter().replace({ name: 'index' });
router.replace({ name: 'index' });
} catch (error: unknown) {
if (error instanceof AppwriteException) {
if (error.type === 'user_session_already_exists') {