feat(auth): Added authentication

This commit is contained in:
Fishandchips321 2026-03-05 12:34:55 +00:00
parent d85d4334f8
commit 5e100c75ed
39 changed files with 704 additions and 86 deletions

13
frontend/src/Lib/Auth.ts Normal file
View file

@ -0,0 +1,13 @@
import axios from "axios"
import { apiUrl } from "./api"
export interface Session {
sessionToken: string;
expiresOn: string;
}
export const logIn = async (username: string, password: string) => {
const response = await axios.post<Session>(`${apiUrl}/auth`, `username=${encodeURI(username)}&password=${encodeURI(password)}`);
return response.data;
}