You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
499 B

2 years ago
  1. import ApiService from '@/services/api.service'
  2. import { AuthRepository } from '@/domain/models/auth/authRepository'
  3. export class APIAuthRepository implements AuthRepository {
  4. constructor(private readonly request = ApiService) {}
  5. async login(username: string, password: string): Promise<void> {
  6. const url = `/auth/login/`
  7. await this.request.post(url, { username, password })
  8. }
  9. async logout(): Promise<void> {
  10. const url = '/auth/logout/'
  11. await this.request.post(url)
  12. }
  13. }