fix: token bug

This commit is contained in:
Lala, Shahd
2026-05-14 22:13:24 +00:00
parent e436dc871c
commit 2e84ec97c2
2 changed files with 6 additions and 13 deletions
@@ -1,9 +1,9 @@
/* ============ THEME TOKENS ============ */
:host {
/* Light mode: warm sunset palette from background gradient */
--nc-accent: #ff6b3d;
--nc-accent: #ff3dbb;
--nc-accent-hover: rgba(255, 107, 61, 0.15);
--nc-accent-badge: rgba(255, 107, 61, 0.9);
--nc-accent-badge: rgba(223, 61, 255, 0.9);
--nc-badge-text: #1a0800;
--nc-surface: rgba(26, 24, 56, 0.97);
--nc-nav-bg: linear-gradient(180deg, rgba(26,24,56,0.88) 0%, rgba(46,32,80,0.6) 70%, rgba(74,41,98,0) 100%);
+4 -11
View File
@@ -1,7 +1,7 @@
import { Injectable, inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { BehaviorSubject, Observable } from 'rxjs';
import { map, tap } from 'rxjs/operators';
import { map, switchMap, tap } from 'rxjs/operators';
import { environment } from '../../environments/environment';
import { LoginRequest, RegisterRequest, RegisterResponse, LoginResponse, CurrentUser } from '../models/auth.models';
@@ -42,16 +42,9 @@ export class AuthService {
email
})
.pipe(
tap((response) => {
localStorage.setItem('username', response.username);
localStorage.setItem('userId', response.id);
this.currentUserSubject.next({
id: response.id,
username: response.username,
rating: response.rating,
createdAt: response.createdAt
});
})
switchMap((response) =>
this.login(username, password).pipe(map(() => response))
)
);
}