File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
adminforth/plugins/two-factors-auth Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,9 @@ const handleSkip = async () => {
187187 const resp = await callAdminForthApi ({
188188 method: ' POST' ,
189189 path: ' /plugin/twofa/confirmSetup' ,
190+ body: {
191+ skip: true ,
192+ }
190193 });
191194 if (resp .allowedLogin ){
192195 await user .finishLogin ()
Original file line number Diff line number Diff line change @@ -117,10 +117,10 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
117117 return { status :'error' , message :'Invalid token' }
118118 }
119119 if ( decoded . newSecret ) {
120- const verified = decoded . userCanSkipSetup ? true : twofactor . verifyToken ( decoded . newSecret , body . code ) ;
120+ const verified = body . skip && decoded . userCanSkipSetup ? true : twofactor . verifyToken ( decoded . newSecret , body . code ) ;
121121 if ( verified ) {
122122 this . connectors = this . adminforth . connectors
123- if ( ! decoded . userCanSkipSetup ) {
123+ if ( ! body . skip ) {
124124 const connector = this . connectors [ this . authResource . dataSource ] ;
125125 await connector . updateRecord ( { resource :this . authResource , recordId :decoded . pk , newValues :{ [ this . options . twoFaSecretFieldName ] : decoded . newSecret } } )
126126 }
You can’t perform that action at this time.
0 commit comments