generated from nhcarrigan/template
chore: lints
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import { Injectable, signal } from '@angular/core';
|
||||
import { Injectable, signal, inject } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { Observable, tap, catchError, switchMap, throwError, of } from 'rxjs';
|
||||
import { ApiService } from './api.service';
|
||||
@@ -16,16 +16,14 @@ import { HttpClient } from '@angular/common/http';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AuthService {
|
||||
private api = inject(ApiService);
|
||||
private router = inject(Router);
|
||||
private http = inject(HttpClient);
|
||||
|
||||
private currentUser = signal<User | null>(null);
|
||||
public readonly user = this.currentUser.asReadonly();
|
||||
private refreshing = false;
|
||||
|
||||
constructor(
|
||||
private api: ApiService,
|
||||
private router: Router,
|
||||
private http: HttpClient
|
||||
) {}
|
||||
|
||||
login(): void {
|
||||
// Redirect to API login endpoint
|
||||
window.location.href = `${environment.apiUrl}/auth/login`;
|
||||
|
||||
Reference in New Issue
Block a user