make exemptions for the oauth_complete and error pages (they should always show without any runtime redirects)

This commit is contained in:
Jacob Overgaard
2024-05-02 12:59:16 +02:00
parent 30e70346b3
commit 8223c35cc2

View File

@@ -195,6 +195,15 @@ export class UmbAppElement extends UmbLitElement {
}
#redirect() {
const pathname = pathWithoutBasePath({ start: true, end: false });
// If we are on the oauth_complete or error page, we should not redirect
if (pathname === '/oauth_complete' || pathname === '/error') {
// Initialize the router
history.replaceState(null, '', location.href);
return;
}
switch (this.#serverConnection?.getStatus()) {
case RuntimeLevelModel.INSTALL:
history.replaceState(null, '', 'install');
@@ -209,8 +218,6 @@ export class UmbAppElement extends UmbLitElement {
break;
case RuntimeLevelModel.RUN: {
const pathname = pathWithoutBasePath({ start: true, end: false });
// If we are on installer or upgrade page, redirect to the root since we are in the RUN state
if (pathname === '/install' || pathname === '/upgrade') {
history.replaceState(null, '', '/');