Skip to content

Commit

Permalink
Fix 2FAS manual import #307
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Jul 27, 2024
1 parent 47e710b commit 0bcdad2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion interface/windows/import/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,12 @@ export const twoFasAuthFile = async () => {

interface TwoFasFile {
services: {
name: string
secret: string
otp: {
link: string
tokenType: string
source: "Link" | "Manual"
}
}[]
}
Expand All @@ -236,7 +239,11 @@ export const twoFasAuthFile = async () => {
console.log(service)

if (service.otp.tokenType === "TOTP") {
importString += totpImageConverter(service.otp.link)
if (service.otp.source === "Link") {
importString += totpImageConverter(service.otp.link)
} else {
importString += totpImageConverter(`otpauth://totp/${service.name}?secret=${service.secret}&issuer=${service.name}`)
}
}
}

Expand Down

0 comments on commit 0bcdad2

Please sign in to comment.