feat: FRO-2 Implement Login Component (#8)

Reviewed-on: #8
Reviewed-by: lq64 <lq@blackhole.local>
Co-authored-by: Janis <janis.e.20@gmx.de>
Co-committed-by: Janis <janis.e.20@gmx.de>
This commit is contained in:
2025-12-10 11:44:33 +01:00
committed by lq64
parent f47b757398
commit eac315bea1
9 changed files with 77 additions and 108 deletions

View File

@@ -0,0 +1,19 @@
import { defineStore } from 'pinia'
import {ref, type Ref} from 'vue'
export const useUserInfo = defineStore('userInfo', () => {
const username: Ref<string | null> = ref(null);
const userId: Ref<number | null> = ref(null);
function setUserInfo(name: string, id: number) {
username.value = name;
userId.value = id;
}
function clearUserInfo() {
username.value = null;
userId.value = null;
}
return { username, userId, setUserInfo, clearUserInfo };
});