add remember me checkbox

This commit is contained in:
john 2025-05-29 13:21:37 +02:00
parent 334435cf78
commit 3b4f384582
6 changed files with 43 additions and 9 deletions

View file

@ -6,9 +6,9 @@ import { ApiClient } from '../api/client.ts'
export class AuthService {
constructor(private readonly client: ApiClient) {}
async login(username: string, password: string) {
async login(username: string, password: string, rememberMe: boolean = false) {
const res = await this.client.POST('/auth/login', {
body: { username, password },
body: { username, password, rememberMe },
credentials: 'include',
})
@ -19,9 +19,9 @@ export class AuthService {
dispatchMessage('auth:logged-in', null)
}
async signup(username: string, password: string, signupCode: string) {
async signup(username: string, password: string, signupCode: string, rememberMe: boolean = false) {
const res = await this.client.POST('/auth/register', {
body: { username, password, signupCode, email: null },
body: { username, password, signupCode, email: null, rememberMe },
credentials: 'include',
})