Compare commits

...

2 commits

Author SHA1 Message Date
advplyr
f0acbb2e81
Merge pull request #4737 from Yetangitu/explicit_oidc_autolaunch
Some checks failed
CodeQL / Analyze (push) Waiting to run
Build and Push Docker Image / build (push) Waiting to run
Integration Test / build and test (push) Waiting to run
Run Unit Tests / Run Unit Tests (push) Waiting to run
Run Component Tests / Run Component Tests (push) Has been cancelled
Explicitly launch OpenID Connect authentication with ?autoLaunch=1
2025-10-09 17:08:51 -05:00
Frank de Lange
fc06aa2c78 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.
2025-10-09 16:02:02 +02:00

View file

@ -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
}