mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Authentication: update passport-ldapauth to 3.0.1; fix minor issues
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import Settings from '@overleaf/settings'
|
||||
import { callbackify } from '@overleaf/promise-utils'
|
||||
import UserCreator from '../../../../../app/src/Features/User/UserCreator.mjs'
|
||||
import { ParallelLoginError } from '../../../../../app/src/Features/Authentication/AuthenticationErrors.mjs'
|
||||
import { User } from '../../../../../app/src/models/User.mjs'
|
||||
|
||||
@@ -2,7 +2,7 @@ import Settings from '@overleaf/settings'
|
||||
import logger from '@overleaf/logger'
|
||||
import { promisify } from 'util'
|
||||
import passport from 'passport'
|
||||
import ldapjs from 'ldapauth-fork/node_modules/ldapjs/lib/index.js'
|
||||
import ldapjs from 'ldapjs'
|
||||
import UserGetter from '../../../../../app/src/Features/User/UserGetter.mjs'
|
||||
import { splitFullName } from '../../../utils.mjs'
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import AuthenticationController from '../../../../../app/src/Features/Authentica
|
||||
import UserController from '../../../../../app/src/Features/User/UserController.mjs'
|
||||
import ThirdPartyIdentityManager from '../../../../../app/src/Features/User/ThirdPartyIdentityManager.mjs'
|
||||
import OIDCAuthenticationManager from './OIDCAuthenticationManager.mjs'
|
||||
import { acceptsJson } from '../../../../../app/src/infrastructure/RequestContentTypeDetection.mjs'
|
||||
|
||||
const OIDCAuthenticationController = {
|
||||
passportLogin(req, res, next) {
|
||||
@@ -142,17 +141,10 @@ const OIDCAuthenticationController = {
|
||||
initiatorId: userId,
|
||||
}
|
||||
await ThirdPartyIdentityManager.promises.unlink(userId, providerId, auditLog)
|
||||
return res.status(200).end()
|
||||
return res.status(204).end()
|
||||
} catch (error) {
|
||||
logger.error(error.info, error.message)
|
||||
return {
|
||||
user: false,
|
||||
info: {
|
||||
type: 'error',
|
||||
text: 'Can not unlink account',
|
||||
status: 200,
|
||||
}
|
||||
}
|
||||
logger.error('Unexpected error in uninkAccount')
|
||||
return next({ stack: error.stack, info: {userId: req.user?._id} })
|
||||
}
|
||||
},
|
||||
async passportLogout(req, res, next) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import logger from '@overleaf/logger'
|
||||
import passport from 'passport'
|
||||
import Settings from '@overleaf/settings'
|
||||
import { readFilesContentFromEnv, numFromEnv, boolFromEnv } from '../../../utils.mjs'
|
||||
import { boolFromEnv } from '../../../utils.mjs'
|
||||
import PermissionsManager from '../../../../../app/src/Features/Authorization/PermissionsManager.mjs'
|
||||
import OIDCAuthenticationController from './OIDCAuthenticationController.mjs'
|
||||
import { Strategy as OIDCStrategy } from 'passport-openidconnect'
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import logger from '@overleaf/logger'
|
||||
import passport from 'passport'
|
||||
import Settings from '@overleaf/settings'
|
||||
import { readFilesContentFromEnv, numFromEnv, boolFromEnv } from '../../../utils.mjs'
|
||||
import PermissionsManager from '../../../../../app/src/Features/Authorization/PermissionsManager.mjs'
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
"parse-data-url": "^2.0.0",
|
||||
"passport": "^0.6.0",
|
||||
"passport-google-oauth20": "^2.0.0",
|
||||
"passport-ldapauth": "^2.1.4",
|
||||
"passport-ldapauth": "^3.0.1",
|
||||
"passport-local": "^1.0.0",
|
||||
"passport-oauth2": "^1.5.0",
|
||||
"passport-openidconnect": "^0.1.2",
|
||||
|
||||
Reference in New Issue
Block a user