mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-01 21:15:00 +02:00
- Implement /auth/openid/mobile-redirect this will redirect to an app-link like audiobookshelf://oauth - An app must provide an `redirect_uri` parameter with the app-link in the authorization request to /auth/openid - The user will have to whitelist possible URLs, or explicitly allow all - Also modified MultiSelect to allow to hide the menu/popup
This commit is contained in:
parent
84160b2f07
commit
80fd2a1a18
7 changed files with 114 additions and 5 deletions
|
@ -629,6 +629,23 @@ class MiscController {
|
|||
} else {
|
||||
Logger.warn(`[MiscController] Invalid value for authActiveAuthMethods`)
|
||||
}
|
||||
} else if (key === 'authOpenIDMobileRedirectURIs') {
|
||||
function isValidRedirectURI(uri) {
|
||||
const pattern = new RegExp('^\\w+://[\\w.-]+$', 'i');
|
||||
return pattern.test(uri);
|
||||
}
|
||||
|
||||
const uris = settingsUpdate[key]
|
||||
if (!Array.isArray(uris) ||
|
||||
(uris.includes('*') && uris.length > 1) ||
|
||||
uris.some(uri => uri !== '*' && !isValidRedirectURI(uri))) {
|
||||
Logger.warn(`[MiscController] Invalid value for authOpenIDMobileRedirectURIs`)
|
||||
continue
|
||||
}
|
||||
|
||||
// Update the URIs
|
||||
Database.serverSettings[key] = uris
|
||||
hasUpdates = true
|
||||
} else {
|
||||
const updatedValueType = typeof settingsUpdate[key]
|
||||
if (['authOpenIDAutoLaunch', 'authOpenIDAutoRegister'].includes(key)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue