Skip to content

Commit

Permalink
fix: redirect admin
Browse files Browse the repository at this point in the history
  • Loading branch information
Chulinuwu committed Dec 19, 2024
1 parent 4b4e8ef commit 9acd664
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/routes/auth/login/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { login } from '$lib/api/login';
import CryptoJS from 'crypto-js';
Expand All @@ -15,11 +16,11 @@
const encryptedToken = CryptoJS.AES.encrypt(token, secretKey).toString();
sessionStorage.setItem('encryptedToken', encryptedToken);
console.log('Login successful:');
// Add navigation or additional logic here
goto('/admin');
} catch (error) {
errorMessage = error instanceof Error ? error.message : 'An unknown error occurred';
}
getDecryptedToken();
// getDecryptedToken();
};
const getDecryptedToken = () => {
Expand Down

0 comments on commit 9acd664

Please sign in to comment.