enhancement(auth): better error message handling

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2023-03-25 18:58:48 +01:00
parent 8e57188ab5
commit ca9836d691
37 changed files with 199 additions and 207 deletions

View file

@ -25,7 +25,7 @@ describe('Auth', () => {
let displayName: string;
let password: string;
beforeAll(async () => {
beforeEach(async () => {
testSetup = await TestSetupBuilder.create().build();
await testSetup.app.init();
@ -34,7 +34,7 @@ describe('Auth', () => {
password = 'test_password';
});
afterAll(async () => {
afterEach(async () => {
// Yes, this is a bad hack, but there is a race somewhere and I have
// no idea how to fix it.
await new Promise((resolve) => {
@ -193,7 +193,7 @@ describe('Auth', () => {
.set('Content-Type', 'application/json')
.set('Cookie', cookie)
.send(JSON.stringify(changePasswordDto))
.expect(400);
.expect(403);
// enable login again
testSetup.configService.get('authConfig').local.enableLogin = true;
// new password doesn't work for login