QR login
This commit is contained in:
@@ -60,6 +60,22 @@ export class AuthService {
|
||||
});
|
||||
}
|
||||
|
||||
/** Check session without updating internal state (for polling) */
|
||||
checkSessionOnce(): Observable<AuthSession | null> {
|
||||
return this.http.get<AuthSession>(`${this.apiUrl}/auth/session`, {
|
||||
withCredentials: true
|
||||
}).pipe(
|
||||
tap(session => {
|
||||
if (session && session.active) {
|
||||
this.sessionSignal.set(session);
|
||||
this.statusSignal.set('authenticated');
|
||||
this.scheduleSessionRefresh(session.expiresAt);
|
||||
}
|
||||
}),
|
||||
catchError(() => of(null))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called after user completes Telegram login.
|
||||
* The callback URL from Telegram will hit our backend which sets the cookie.
|
||||
|
||||
Reference in New Issue
Block a user