first steps

This commit is contained in:
2026-04-07 22:53:49 +02:00
parent 5d582461e2
commit f21dfa9c8c
7 changed files with 22 additions and 38 deletions

View File

@@ -1,5 +1,5 @@
import type { $Fetch } from 'ofetch';
import type { User, ConfirmResult } from '~/types/auth'
import type { User, ConfirmResult, LoginResponse } from '~/types/auth'
export default class UserRepository {
private fetcher: $Fetch;
@@ -9,7 +9,7 @@ export default class UserRepository {
}
async confirm(token: string){
return await this.fetcher<ConfirmResult>('/auth/confirm', {
return await this.fetcher<ConfirmResult>('/user/confirm', {
method: 'POST',
body: {
token
@@ -17,11 +17,11 @@ export default class UserRepository {
})
}
async register(email: string, password:string, locale:string){
return await this.fetcher<ConfirmResult>('/user/register', {
async register(email: string, password:string){
return await this.fetcher<LoginResponse>('/auth/register', {
method: 'POST',
body:{
email, password, locale
email, password
}
})
}