mirror of
https://github.com/linuxserver/heimdalljs.git
synced 2026-02-20 05:12:24 +08:00
added issuer and label to qr code
This commit is contained in:
parent
e5251b604f
commit
bee07eb72c
@ -138,7 +138,13 @@ router.put('/:id', upload.single('avatar'), async (req, res, next) => {
|
||||
// Begin process to set up and confirm multi-factor authentication
|
||||
if (user.multifactorEnabled === false && !!req.body.multifactorEnabled === true) {
|
||||
const secret = Speakeasy.generateSecret({ length: 10 })
|
||||
const qrcode = await QRCode.toDataURL(secret.otpauth_url, { scale: 6 })
|
||||
const url = Speakeasy.otpauthURL({
|
||||
secret: secret.base32,
|
||||
encoding: 'base32',
|
||||
issuer: 'Heimdall',
|
||||
label: user.username
|
||||
})
|
||||
const qrcode = await QRCode.toDataURL(url, { scale: 6 })
|
||||
|
||||
user.update({
|
||||
totpSecret: secret.base32
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user