-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from FinotiLucas/develop
Update package and fix QR code generation issues
- Loading branch information
Showing
13 changed files
with
73 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
package-lock=false | ||
auto-install-peers=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import pluginJs from '@eslint/js' | ||
import tseslint from 'typescript-eslint' | ||
|
||
/** @type {import('eslint').Linter.Config[]} */ | ||
export default [ | ||
{ files: ['**/*.{js,mjs,cjs,ts}'] }, | ||
{ | ||
ignores: ['**/bin/*', '**/docs/*', '**/tests/*', 'tsconfig.json'], | ||
}, | ||
|
||
pluginJs.configs.recommended, | ||
...tseslint.configs.recommended, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ test.group('TwoFactorAuthManager', () => { | |
const email = '[email protected]' | ||
const manager = new TwoFactorAuthManager({ issuer }) | ||
|
||
const twoFactorSecret = manager.generateSecret(email) | ||
const twoFactorSecret = await manager.generateSecret(email) | ||
|
||
assert.properties(twoFactorSecret, ['secret', 'uri', 'qr']) | ||
assert.equal(twoFactorSecret.secret.length, 32) | ||
|
@@ -46,7 +46,7 @@ test.group('TwoFactorAuthManager', () => { | |
test('it should be able to verify a valid secret and OTP', async ({ assert }) => { | ||
const manager = new TwoFactorAuthManager({ issuer }) | ||
|
||
const { secret } = manager.generateSecret('any') | ||
const { secret } = await manager.generateSecret('any') | ||
|
||
const token = manager.generateToken(secret)! | ||
|
||
|
@@ -58,7 +58,7 @@ test.group('TwoFactorAuthManager', () => { | |
test('it not should be able to verify a valid secret and invalid OTP', async ({ assert }) => { | ||
const manager = new TwoFactorAuthManager({ issuer }) | ||
|
||
const { secret } = manager.generateSecret('any') | ||
const { secret } = await manager.generateSecret('any') | ||
|
||
const isValid = manager.verifyToken(secret, 'something') | ||
|
||
|
@@ -68,7 +68,7 @@ test.group('TwoFactorAuthManager', () => { | |
test('it not should be able to verify a invalid secret and valid OTP', async ({ assert }) => { | ||
const manager = new TwoFactorAuthManager({ issuer }) | ||
|
||
const { secret } = manager.generateSecret('any') | ||
const { secret } = await manager.generateSecret('any') | ||
|
||
const token = manager.generateToken(secret)! | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"extends": "@adonisjs/tsconfig/tsconfig.package.json", | ||
"compilerOptions": { | ||
"target": "esnext", | ||
"moduleResolution": "nodenext", | ||
"rootDir": "./", | ||
"outDir": "./build", | ||
"outDir": "./build" | ||
}, | ||
"exclude": [ | ||
"docs" | ||
] | ||
"exclude": ["docs"] | ||
} |