Merge branch '5475-email_2fa' of https://gitea.verdnatura.es/verdnatura/salix into 5475-email_2fa
This commit is contained in:
commit
162faf0d01
|
@ -71,8 +71,6 @@ fdescribe('VnUser Sign-in()', () => {
|
||||||
expect(error).toBeDefined();
|
expect(error).toBeDefined();
|
||||||
expect(error.statusCode).toBe(403);
|
expect(error.statusCode).toBe(403);
|
||||||
expect(error.message).toBe('REQUIRES_2FA');
|
expect(error.message).toBe('REQUIRES_2FA');
|
||||||
|
|
||||||
await employee.updateAttribute('twoFactor', null);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const {models} = require('vn-loopback/server/server');
|
const {models} = require('vn-loopback/server/server');
|
||||||
|
|
||||||
fdescribe('VnUser validate-auth()', () => {
|
describe('VnUser validate-auth()', () => {
|
||||||
describe('validateAuth', () => {
|
describe('validateAuth', () => {
|
||||||
it('should signin if data is correct', async() => {
|
it('should signin if data is correct', async() => {
|
||||||
await models.AuthCode.create({
|
await models.AuthCode.create({
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
autocomplete="false">
|
autocomplete="false">
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
<vn-textfield
|
<vn-textfield
|
||||||
ng-if="$ctrl.$state.params.twoFactor"
|
ng-if="$ctrl.$state.params.twoFactor == 'true'"
|
||||||
label="Verification code"
|
label="Verification code"
|
||||||
ng-model="$ctrl.code"
|
ng-model="$ctrl.code"
|
||||||
vn-name="code"
|
vn-name="code"
|
||||||
|
|
|
@ -15,6 +15,10 @@ export default class Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
$onInit() {
|
$onInit() {
|
||||||
|
this.oldPassword = 'nightmare';
|
||||||
|
this.repeatPassword = 'test.1234';
|
||||||
|
this.newPassword = 'test.1234';
|
||||||
|
this.verificationCode = '1234';
|
||||||
if (!this.$state.params.id)
|
if (!this.$state.params.id)
|
||||||
this.$state.go('login');
|
this.$state.go('login');
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const {models} = require('vn-loopback/server/server');
|
const {models} = require('vn-loopback/server/server');
|
||||||
|
|
||||||
fdescribe('account changePassword()', () => {
|
describe('account changePassword()', () => {
|
||||||
const ctx = {req: {accessToken: {userId: 70}}};
|
const ctx = {req: {accessToken: {userId: 70}}};
|
||||||
const unauthCtx = {
|
const unauthCtx = {
|
||||||
req: {
|
req: {
|
||||||
|
|
|
@ -37,6 +37,13 @@
|
||||||
"principalType": "ROLE",
|
"principalType": "ROLE",
|
||||||
"principalId": "$authenticated",
|
"principalId": "$authenticated",
|
||||||
"permission": "ALLOW"
|
"permission": "ALLOW"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"property": "changePassword",
|
||||||
|
"accessType": "EXECUTE",
|
||||||
|
"principalType": "ROLE",
|
||||||
|
"principalId": "$everyone",
|
||||||
|
"permission": "ALLOW"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue