From bc174f7cbae06975275e4ab1e59753e8d24e949d Mon Sep 17 00:00:00 2001 From: sdarbinyan Date: Mon, 1 Jun 2026 02:15:38 +0400 Subject: [PATCH] change api check --- src/app/auth-session.service.ts | 2 +- src/app/pages/fastcheck-page/fastcheck-page.ts | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/app/auth-session.service.ts b/src/app/auth-session.service.ts index 830b10a..44e1dd4 100644 --- a/src/app/auth-session.service.ts +++ b/src/app/auth-session.service.ts @@ -197,6 +197,6 @@ export class AuthSessionService { return; } - document.cookie = `${this.cookieName}=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax`; + // document.cookie = `${this.cookieName}=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax`; } } \ No newline at end of file diff --git a/src/app/pages/fastcheck-page/fastcheck-page.ts b/src/app/pages/fastcheck-page/fastcheck-page.ts index b03be8c..e92a9a0 100644 --- a/src/app/pages/fastcheck-page/fastcheck-page.ts +++ b/src/app/pages/fastcheck-page/fastcheck-page.ts @@ -279,16 +279,12 @@ export class FastcheckPage { event.preventDefault(); const id = this.partnerId() || this.defaultPartnerId; - const sessionId = this.authSession.getSessionId(); - - if (!sessionId) { - this.openAuth('new'); - return; - } - - this.authSession.validateSession(sessionId).subscribe({ + // Validate any stored session (cookie) with the server first. + // If there's no valid stored session — open the auth dialog to create one. + this.authSession.validateStoredSession().subscribe({ next: (response) => { - if (!response) { + const sessionId = this.authSession.getSessionId(); + if (!sessionId) { this.openAuth('new'); return; }