Merge branch '5475-email_2fa' of https://gitea.verdnatura.es/verdnatura/salix into 5475-email_2fa

This commit is contained in:
Alex Moreno 2023-06-28 07:18:10 +02:00
commit 162faf0d01
6 changed files with 14 additions and 5 deletions

View File

@ -71,8 +71,6 @@ fdescribe('VnUser Sign-in()', () => {
expect(error).toBeDefined();
expect(error.statusCode).toBe(403);
expect(error.message).toBe('REQUIRES_2FA');
await employee.updateAttribute('twoFactor', null);
});
});

View File

@ -1,6 +1,6 @@
const {models} = require('vn-loopback/server/server');
fdescribe('VnUser validate-auth()', () => {
describe('VnUser validate-auth()', () => {
describe('validateAuth', () => {
it('should signin if data is correct', async() => {
await models.AuthCode.create({

View File

@ -22,7 +22,7 @@
autocomplete="false">
</vn-textfield>
<vn-textfield
ng-if="$ctrl.$state.params.twoFactor"
ng-if="$ctrl.$state.params.twoFactor == 'true'"
label="Verification code"
ng-model="$ctrl.code"
vn-name="code"

View File

@ -15,6 +15,10 @@ export default class Controller {
}
$onInit() {
this.oldPassword = 'nightmare';
this.repeatPassword = 'test.1234';
this.newPassword = 'test.1234';
this.verificationCode = '1234';
if (!this.$state.params.id)
this.$state.go('login');

View File

@ -1,6 +1,6 @@
const {models} = require('vn-loopback/server/server');
fdescribe('account changePassword()', () => {
describe('account changePassword()', () => {
const ctx = {req: {accessToken: {userId: 70}}};
const unauthCtx = {
req: {

View File

@ -37,6 +37,13 @@
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW"
},
{
"property": "changePassword",
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
]
}