Add password-based auth with JWT and remember-me

This commit is contained in:
X4Lo committed 2026-06-23 04:11:01 +01:00
1 parent 89deb869ab
commit 0042e7150c
10 files changed
+281 -37

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
import { api } from '@/lib/api';
export const authApi = {
login: (password: string, remember: boolean) =>
api
.post<{ token: string; expiresIn: string }>('/auth/login', {
password,
remember,
})
.then((r) => r.data),
verify: (token: string) =>
api
.get<{ valid: boolean }>('/auth/verify', {
headers: { Authorization: `Bearer ${token}` },
})
.then((r) => r.data),
};