Skip to content

Commit

Permalink
fix: do not require verification by default post login (boolean option)
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Dec 14, 2023
1 parent 60e48c4 commit ffbde43
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function hasTranslationHelper(ctx) {
class Policies {
constructor(config, findByTokenFn) {
this.config = {
requireVerificationPostLogin: false,
verifyRoute: '/verify',
loginRoute: '/login',
loginOtpRoute: '/otp/login',
Expand Down Expand Up @@ -201,7 +202,10 @@ class Policies {
}

// check if the user has a verified email
return this.checkVerifiedEmail(ctx, next);
if (this.config.requireVerificationPostLogin)
return this.checkVerifiedEmail(ctx, next);

return next();
}

async ensureApiToken(ctx, next) {
Expand Down

0 comments on commit ffbde43

Please sign in to comment.