From 22930ade66d24a15337e3ae4777e253be45a7d56 Mon Sep 17 00:00:00 2001 From: Oleksandra Matviienko Date: Wed, 27 May 2026 10:24:28 +0200 Subject: [PATCH] Fixed default dashboard not opening after OAuth2 login MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OAuth2 redirect to root URL (/?accessToken=...&refreshToken=...) authenticates the user in a single selectUserReady emission, which skip(1) in app.component was unconditionally swallowing — gotoDefaultPlace never fired and the user landed on /home instead of their default dashboard. Same bug for ?username=&password= URL logins. Deep-link OAuth2 (with prev_uri cookie) is preserved by the pathname === '/' guard. --- ui-ngx/src/app/app.component.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/app.component.ts b/ui-ngx/src/app/app.component.ts index dcb5ec1e1f..df2191438e 100644 --- a/ui-ngx/src/app/app.component.ts +++ b/ui-ngx/src/app/app.component.ts @@ -92,6 +92,14 @@ export class AppComponent { } setupAuth() { + // URL-token login (OAuth2 redirect to root) emits selectUserReady once; + // skip(1) would swallow it and gotoDefaultPlace would never fire. + const params = new URLSearchParams(window.location.search); + const hasRootUrlAuth = window.location.pathname === '/' && ( + !!params.get('accessToken') || + (!!params.get('username') && !!params.get('password')) + ); + this.store.select(selectUserReady).pipe( filter((data) => data.isUserLoaded), tap((data) => { @@ -102,7 +110,7 @@ export class AppComponent { } this.notifyUserLang(userLang); }), - skip(1), + skip(hasRootUrlAuth ? 0 : 1), ).subscribe((data) => { this.authService.gotoDefaultPlace(data.isAuthenticated); });