File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ class Policies {
5050 this . ensureTurnstile = this . ensureTurnstile . bind ( this ) ;
5151 }
5252
53+ // eslint-disable-next-line complexity
5354 async checkVerifiedEmail ( ctx , next ) {
5455 if ( ! ctx . isAuthenticated ( ) ) {
5556 ctx . session . returnTo = ctx . originalUrl || ctx . req . url ;
@@ -86,16 +87,24 @@ class Policies {
8687 return ;
8788 }
8889
89- if ( ! this . config . userFields . hasVerifiedEmail ) return next ( ) ;
90+ if ( ! this . config . userFields . hasVerifiedEmail ) {
91+ if ( next ) return next ( ) ;
92+ return ;
93+ }
9094
91- if ( ctx . state . user [ this . config . userFields . hasVerifiedEmail ] ) return next ( ) ;
95+ if ( ctx . state . user [ this . config . userFields . hasVerifiedEmail ] ) {
96+ if ( next ) return next ( ) ;
97+ return ;
98+ }
9299
93100 if (
94101 typeof ctx . pathWithoutLocale === 'string'
95102 ? ctx . pathWithoutLocale === this . config . verifyRoute
96103 : ctx . path === this . config . verifyRoute
97- )
98- return next ( ) ;
104+ ) {
105+ if ( next ) return next ( ) ;
106+ return ;
107+ }
99108
100109 const message = ctx . translate
101110 ? ctx . translate ( 'EMAIL_VERIFICATION_REQUIRED' )
You can’t perform that action at this time.
0 commit comments