- added backup codes for 2 factor authentication
Some checks failed
CI Pipeline / japa-tests (push) Failing after 58s
Some checks failed
CI Pipeline / japa-tests (push) Failing after 58s
- npm updates - coverage validation: elevation ust be positive, depth must be negative - vinejs-provider.js: get enabled extensions from database, not via validOptions.extnames - vue components for backup codes: e.g.: PersonalSettings.vue - validate spaital coverage in leaflet map: draw.component.vue, map.component.vue - add backup code authentication into Login.vue - preset to use no preferred reviewer: Release.vue - 2 new vinejs validation rules: file_scan.ts and file-length.ts
This commit is contained in:
parent
ac473b1e72
commit
005df2e454
32 changed files with 1416 additions and 526 deletions
|
@ -1,5 +1,6 @@
|
|||
// import Config from '@ioc:Adonis/Core/Config';
|
||||
import config from '@adonisjs/core/services/config'
|
||||
// import config from '@adonisjs/core/services/config'
|
||||
import env from '#start/env';
|
||||
import User from '#models/user';
|
||||
import { generateSecret, verifyToken } from 'node-2fa/dist/index.js';
|
||||
// import cryptoRandomString from 'crypto-random-string';
|
||||
|
@ -14,7 +15,7 @@ import { TotpState } from '#contracts/enums';
|
|||
// npm i --save-dev @types/qrcode
|
||||
|
||||
class TwoFactorAuthProvider {
|
||||
private issuer: string = config.get('twoFactorAuthConfig.app.name') || 'TethysCloud';
|
||||
private issuer: string = env.get('APP_NAME') || 'TethysCloud';
|
||||
|
||||
/**
|
||||
* generateSecret will generate a user-specific 32-character secret.
|
||||
|
@ -41,7 +42,7 @@ class TwoFactorAuthProvider {
|
|||
* Return recovery codes
|
||||
* @return {string[]}
|
||||
*/
|
||||
public generateRecoveryCodes() {
|
||||
public generateRecoveryCodes(): string[] {
|
||||
const recoveryCodeLimit: number = 8;
|
||||
const codes: string[] = [];
|
||||
for (let i = 0; i < recoveryCodeLimit; i++) {
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue