All checks were successful
Auto Tag Develop / tag (push) Successful in 5s
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | #322 | Page horaire | ## Description de la PR [#322] Page horaire ## Modification du .env ## Check list - [ ] Pas de régression - [ ] TU/TI/TF rédigée - [ ] TU/TI/TF OK - [ ] CHANGELOG modifié Reviewed-on: #4 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
23 lines
587 B
TypeScript
23 lines
587 B
TypeScript
import type { UserData } from './dto/user-data'
|
|
|
|
export const getCurrentUser = () => {
|
|
const api = useApi()
|
|
return api.get<UserData>('/me', {}, { toastErrorKey: 'errors.auth.session' })
|
|
}
|
|
|
|
export const login = (username: string, password: string) => {
|
|
const api = useApi()
|
|
return api.post('/login_check', { username, password }, {
|
|
toastOn401: true,
|
|
toastErrorKey: 'errors.auth.login'
|
|
})
|
|
}
|
|
|
|
export const logout = () => {
|
|
const api = useApi()
|
|
return api.post('/logout', {}, {
|
|
toastErrorKey: 'errors.auth.logout',
|
|
toastSuccessKey: 'success.auth.logout'
|
|
})
|
|
}
|