test(e2e): add TotpFactory with fixed seed
This commit is contained in:
parent
3271c8600a
commit
3816349258
|
|
@ -0,0 +1,18 @@
|
|||
import {Factory} from '../support/factory'
|
||||
|
||||
// Fixed base32 secret so tests can generate deterministic codes with otplib.
|
||||
export const FIXED_TOTP_SECRET = 'JBSWY3DPEHPK3PXP'
|
||||
|
||||
export class TotpFactory extends Factory {
|
||||
static table = 'totp'
|
||||
|
||||
static factory() {
|
||||
return {
|
||||
id: '{increment}',
|
||||
user_id: 1,
|
||||
secret: FIXED_TOTP_SECRET,
|
||||
enabled: true,
|
||||
url: `otpauth://totp/Vikunja:test?secret=${FIXED_TOTP_SECRET}&issuer=Vikunja`,
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue