diff --git a/packages/nocodb/src/lib/meta/api/userApi/initStrategies.ts b/packages/nocodb/src/lib/meta/api/userApi/initStrategies.ts index c513adb559..be6ee74fbf 100644 --- a/packages/nocodb/src/lib/meta/api/userApi/initStrategies.ts +++ b/packages/nocodb/src/lib/meta/api/userApi/initStrategies.ts @@ -207,6 +207,13 @@ export function initStrategies(router): void { if (!user) { return done({ msg: `Email ${email} is not registered!` }); } + + if (!user.salt) { + return done({ + msg: `Please sign up with the invite token first!`, + }); + } + const hashedPassword = await promisify(bcrypt.hash)( password, user.salt diff --git a/packages/nocodb/src/lib/v1-legacy/gql/GqlAuthResolver.ts b/packages/nocodb/src/lib/v1-legacy/gql/GqlAuthResolver.ts index 98b413bb28..0ef9902abe 100644 --- a/packages/nocodb/src/lib/v1-legacy/gql/GqlAuthResolver.ts +++ b/packages/nocodb/src/lib/v1-legacy/gql/GqlAuthResolver.ts @@ -162,7 +162,11 @@ export default class GqlAuthResolver { if (!user) { return done({ msg: `Email ${email} is not registered!` }); } - + if (!user.salt) { + return done({ + msg: `Please sign up with the invite token first!`, + }); + } const hashedPassword = await promisify(bcrypt.hash)( password, user.salt diff --git a/packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts b/packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts index 00a85d4ef6..b47d108cda 100644 --- a/packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts +++ b/packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts @@ -334,6 +334,11 @@ export default class RestAuthCtrl { if (!user) { return done({ msg: `Email ${email} is not registered!` }); } + if (!user.salt) { + return done({ + msg: `Please sign up with the invite token first!`, + }); + } const hashedPassword = await promisify(bcrypt.hash)( password, user.salt