mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-09-01 13:51:27 +02:00
fixed server crash because of unregistered openidconnect strategy
This commit is contained in:
parent
5a6609150c
commit
339883405f
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "audiobookshelf",
|
||||
"version": "1.6.64",
|
||||
"version": "1.6.65",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "audiobookshelf",
|
||||
"version": "1.6.64",
|
||||
"version": "1.6.65",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"archiver": "^5.3.0",
|
||||
|
@ -260,16 +260,22 @@ class Server {
|
||||
|
||||
app.post('/logout', this.authMiddleware.bind(this), this.logout.bind(this))
|
||||
|
||||
app.get("/oidc/login", passport.authenticate('openidconnect'))
|
||||
app.get("/oidc/login", (() => {
|
||||
if (!this.db.SSOSettings.isOIDCConfigured) return (req, res) => res.redirect("/");
|
||||
return passport.authenticate('openidconnect')
|
||||
})())
|
||||
|
||||
app.get("/oidc/callback",
|
||||
passport.authenticate('openidconnect', { failureRedirect: '/oidc/login', failureMessage: true }),
|
||||
async (req, res) => {
|
||||
const token = this.auth.generateAccessToken({ userId: req.user.id })
|
||||
res.cookie('sso', true, { httpOnly: false /* TODO: Set secure: true */ });
|
||||
(() => {
|
||||
if (!this.db.SSOSettings.isOIDCConfigured) return (req, res) => res.redirect("/");
|
||||
return passport.authenticate('openidconnect', { failureRedirect: '/oidc/login', failureMessage: true }),
|
||||
async (req, res) => {
|
||||
const token = this.auth.generateAccessToken({ userId: req.user.id })
|
||||
res.cookie('sso', true, { httpOnly: false /* TODO: Set secure: true */ });
|
||||
|
||||
res.redirect('/');
|
||||
}
|
||||
res.redirect('/');
|
||||
}
|
||||
})()
|
||||
)
|
||||
|
||||
app.get('/ping', (req, res) => {
|
||||
|
Loading…
Reference in New Issue
Block a user