redirect fails to the api login endpoint

This commit is contained in:
Erik 2022-11-20 18:37:07 +02:00
parent 323cfe55df
commit 18d52123ef
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -68,10 +68,10 @@ class Authenticator {
* *
* @param {string} name Name of strategy used, auth middleware is also bound to authenticator[name] * @param {string} name Name of strategy used, auth middleware is also bound to authenticator[name]
* @param {Strategy} strategy Passport strategy * @param {Strategy} strategy Passport strategy
* @param {object} [{ failureRedirect = '/login/fail', successRedirect = '/home' }={}] * @param {object} [{ failureRedirect = '/api/login/fail', successRedirect = '/home' }={}]
* @memberof Authenticator * @memberof Authenticator
*/ */
addStrategy (name, strategy, { failureRedirect = '/login/fail', successRedirect } = {}) { addStrategy (name, strategy, { failureRedirect = '/api/login/fail', successRedirect } = {}) {
this.logger.info(`Adding ${name} authentication strategy`); this.logger.info(`Adding ${name} authentication strategy`);
this.passport.use(name, strategy); this.passport.use(name, strategy);
// Quick access getter to get the middleware for authenticating // Quick access getter to get the middleware for authenticating