File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -245,14 +245,24 @@ plugin.saveAuthn = (uid, authnrData) => {
245245 db . sortedSetAdd ( `2factor:webauthn:counters` , counter , id ) ;
246246} ;
247247
248- plugin . hasAuthn = async uid => db . exists ( `2factor:webauthn:${ uid } ` ) ;
248+ plugin . hasAuthn = async ( uid ) => {
249+ if ( ! ( parseInt ( uid , 10 ) > 0 ) ) {
250+ return false ;
251+ }
252+ return await db . exists ( `2factor:webauthn:${ uid } ` ) ;
253+ } ;
249254
250- plugin . hasTotp = async uid => db . isObjectField ( '2factor:uid:key' , uid ) ;
255+ plugin . hasTotp = async ( uid ) => {
256+ if ( ! ( parseInt ( uid , 10 ) > 0 ) ) {
257+ return false ;
258+ }
259+ return await db . isObjectField ( '2factor:uid:key' , uid ) ;
260+ } ;
251261
252262// hmm... remove?
253263plugin . hasKey = async ( uid ) => {
254264 const [ hasTotp , hasAuthn ] = await Promise . all ( [
255- db . isObjectField ( '2factor:uid:key' , uid ) ,
265+ plugin . hasTotp ( uid ) ,
256266 plugin . hasAuthn ( uid ) ,
257267 ] ) ;
258268
You can’t perform that action at this time.
0 commit comments