Skip to content

Commit 6038d6c

Browse files
feat: add needTokenCode method to support all token-based authentication
Adds needTokenCode() method that checks for any active token-based authentication method (SMS, WhatsApp, Signal, Telegram, XMPP) needing a verification code. This replaces the SMS-only needSmsCode() check and enables proper modal display for all token-based methods. Signed-off-by: Vitor Mattos <[email protected]>
1 parent 5b8258c commit 6038d6c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/store/signMethods.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ export const useSignMethodsStore = defineStore('signMethods', {
7777
return Object.hasOwn(this.settings, 'sms')
7878
&& this.settings.sms.needCode
7979
},
80+
needTokenCode() {
81+
const tokenMethods = ['sms', 'whatsapp', 'signal', 'telegram', 'xmpp']
82+
return tokenMethods.some(method =>
83+
Object.hasOwn(this.settings, method) && this.settings[method].needCode
84+
)
85+
},
8086
needCertificate() {
8187
return this.certificateEngine === 'none' && !this.hasSignatureFile()
8288
},

0 commit comments

Comments
 (0)