mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-10-04 19:05:39 +08:00
fixed issue with req.accessToken
This commit is contained in:
parent
e4a20f3f4f
commit
b26a749e70
4 changed files with 4 additions and 4 deletions
|
@ -189,7 +189,7 @@ module.exports = (db, server, userHandler) => {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (disabled2fa && typeof req.accessToken.update === 'function') {
|
if (disabled2fa && req.accessToken && typeof req.accessToken.update === 'function') {
|
||||||
try {
|
try {
|
||||||
// update access token data for current session after U2F enabled
|
// update access token data for current session after U2F enabled
|
||||||
await req.accessToken.update();
|
await req.accessToken.update();
|
||||||
|
|
|
@ -208,7 +208,7 @@ module.exports = (db, server, userHandler) => {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (disabled2fa && typeof req.accessToken.update === 'function') {
|
if (disabled2fa && req.accessToken && typeof req.accessToken.update === 'function') {
|
||||||
try {
|
try {
|
||||||
// update access token data for current session after U2F enabled
|
// update access token data for current session after U2F enabled
|
||||||
await req.accessToken.update();
|
await req.accessToken.update();
|
||||||
|
|
|
@ -158,7 +158,7 @@ module.exports = (db, server, userHandler) => {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (disabled2fa && typeof req.accessToken.update === 'function') {
|
if (disabled2fa && req.accessToken && typeof req.accessToken.update === 'function') {
|
||||||
try {
|
try {
|
||||||
// update access token data for current session after U2F enabled
|
// update access token data for current session after U2F enabled
|
||||||
await req.accessToken.update();
|
await req.accessToken.update();
|
||||||
|
|
|
@ -1511,7 +1511,7 @@ module.exports = (db, server, userHandler) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
let { success, passwordChanged } = updateResponse || {};
|
let { success, passwordChanged } = updateResponse || {};
|
||||||
if (passwordChanged && typeof req.accessToken.update === 'function') {
|
if (passwordChanged && req.accessToken && typeof req.accessToken.update === 'function') {
|
||||||
try {
|
try {
|
||||||
// update access token data for current session after password change
|
// update access token data for current session after password change
|
||||||
await req.accessToken.update();
|
await req.accessToken.update();
|
||||||
|
|
Loading…
Add table
Reference in a new issue