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.
This commit is contained in:
Frank de Lange 2025-10-09 16:02:02 +02:00
parent 2592467d09
commit fc06aa2c78

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
}