From fc06aa2c788fd47957cffda3047eb2ef9f18c8ce Mon Sep 17 00:00:00 2001 From: Frank de Lange Date: Thu, 9 Oct 2025 16:02:02 +0200 Subject: [PATCH] Explicitly launch OpenID Connect authentication with ?autoLaunch=1 This change extends OIDC authentication by enabling explicit redirection to the OAuth provider when navigating to the login page with the manual override parameter (/login?autoLaunch=1). Use case: directly launch audiobookshelf from within e.g. Nextcloud using the external sites app (use something like https://abs.example.org/login?autoLaunch=1 as URL) while keeping the possibility to launch audiobookshelf using its built-in authentication mechanism. Assuming the username or mail address used in Nextcloud and audiobookshelf are identical the user will be logged in to his or her account no matter which method is used. --- client/pages/login.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/pages/login.vue b/client/pages/login.vue index 60f31eca5..8e5cde098 100644 --- a/client/pages/login.vue +++ b/client/pages/login.vue @@ -299,8 +299,8 @@ export default { } if (authMethods.includes('openid')) { - // Auto redirect unless query string ?autoLaunch=0 - if (this.authFormData?.authOpenIDAutoLaunch && this.$route.query?.autoLaunch !== '0') { + // Auto redirect unless query string ?autoLaunch=0 OR when explicity requested through ?autoLaunch=1 + if ((this.authFormData?.authOpenIDAutoLaunch && this.$route.query?.autoLaunch !== '0') || this.$route.query?.autoLaunch == '1') { window.location.href = this.openidAuthUri }