Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

fix(frontend:auth): allow retrying OIDC login

johaven003b30713556
diff --git a/frontend/src/app/auth/auth.component.html b/frontend/src/app/auth/auth.component.html
index d7612239..5ddc036e 100644
--- a/frontend/src/app/auth/auth.component.html
+++ b/frontend/src/app/auth/auth.component.html
@@ -74,7 +74,6 @@
<button
type="button"
class="btn btn-lg btn-primary w-100"
- [disabled]="OIDCSubmitted"
(click)="loginWithOIDC()">
<span l10nTranslate>{{ oidcSettings.buttonText }}</span>
</button>
diff --git a/frontend/src/app/auth/auth.component.ts b/frontend/src/app/auth/auth.component.ts
index 2024eb1c..2e01d1c3 100644
--- a/frontend/src/app/auth/auth.component.ts
+++ b/frontend/src/app/auth/auth.component.ts
@@ -29,7 +29,6 @@ export class AuthComponent {
protected logoUrl = logoDarkUrl
protected hasError: any = null
protected submitted = false
- protected OIDCSubmitted = false
protected twoFaVerify = false
private route = inject(ActivatedRoute)
protected oidcSettings: AuthOIDCSettings | false = this.route.snapshot.data.authSettings
@@ -97,12 +96,10 @@ export class AuthComponent {
window.location.assign(this.oidcSettings.loginUrl)
return
}
- this.OIDCSubmitted = true
try {
const desktopPort = await this.auth.electron.startOIDCDesktopAuth()
if (!desktopPort) {
- this.OIDCSubmitted = false
console.error('OIDC desktop auth failed')
return
}
@@ -120,7 +117,6 @@ export class AuthComponent {
this.auth.electron.setActiveAndShow()
})
.catch((e: Error) => {
- this.OIDCSubmitted = false
console.error('Unavailable OIDC desktop callback params:', e)
})
@@ -128,7 +124,6 @@ export class AuthComponent {
// The backend sends the oidc cookies to desktop app before the redirection.
window.location.assign(`${this.oidcSettings.loginUrl}?${this.auth.electron.genParamOIDCDesktopPort(desktopPort)}`)
} catch (e) {
- this.OIDCSubmitted = false
console.error(e)
}
}
diff --git a/frontend/src/app/auth/auth.service.ts b/frontend/src/app/auth/auth.service.ts
index 34b831e9..7747ccb1 100644
--- a/frontend/src/app/auth/auth.service.ts
+++ b/frontend/src/app/auth/auth.service.ts
@@ -290,7 +290,7 @@ export class AuthService {
)
}),
catchError((e: HttpErrorResponse) => {
- console.error(`${this.authOIDCDesktopClient.name} - ${e}`)
+ console.error(`${this.authOIDCDesktopClient.name} - ${e.error?.message ?? e}`)
this.logout(true)
return of(false)
})