Skip to content

Commit b04739e

Browse files
committed
make exemptions for the oauth_complete and error pages (they should always show without any runtime redirects)
1 parent 491547b commit b04739e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/apps/app/app.element.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,15 @@ export class UmbAppElement extends UmbLitElement {
195195
}
196196

197197
#redirect() {
198+
const pathname = pathWithoutBasePath({ start: true, end: false });
199+
200+
// If we are on the oauth_complete or error page, we should not redirect
201+
if (pathname === '/oauth_complete' || pathname === '/error') {
202+
// Initialize the router
203+
history.replaceState(null, '', location.href);
204+
return;
205+
}
206+
198207
switch (this.#serverConnection?.getStatus()) {
199208
case RuntimeLevelModel.INSTALL:
200209
history.replaceState(null, '', 'install');
@@ -209,8 +218,6 @@ export class UmbAppElement extends UmbLitElement {
209218
break;
210219

211220
case RuntimeLevelModel.RUN: {
212-
const pathname = pathWithoutBasePath({ start: true, end: false });
213-
214221
// If we are on installer or upgrade page, redirect to the root since we are in the RUN state
215222
if (pathname === '/install' || pathname === '/upgrade') {
216223
history.replaceState(null, '', '/');

0 commit comments

Comments
 (0)