Skip to content

Commit

Permalink
moved login to site directories and added route to log in page in sit…
Browse files Browse the repository at this point in the history
…e dirs
  • Loading branch information
Deraingo committed Jun 18, 2024
1 parent cfe2f0c commit 3374022
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion site/src/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ const routes: RouteRecordRaw[] = [
{ path: 'substitution', component: () => import('pages/information/SubstitutionPage.vue') },
],
},

{
path: '/sign-in',
component: () => import('pages/sign-in.vue'), // Sign-In page route
},
// Always leave this as last one,
// but you can also remove it
{
Expand Down
10 changes: 8 additions & 2 deletions site/src/stores/user-store.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { defineStore } from 'pinia';

interface User {
id: number;
name: string;
// Add other properties as needed
}

export const useUserStore = defineStore('user', {
state: () => ({
user: null,
user: null as User | null,
}),
actions: {
setUser(user) {
setUser(user: User | null) {
this.user = user;
},
clearUser() {
Expand Down

0 comments on commit 3374022

Please sign in to comment.