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.

18 lines
507 B

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