mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor(server)!: remove redundant error and statusCode fields from error responses (#28140)
* refactor(server)!: remove redundant error and statusCode fields from error responses * use enum * enhance response management * chore: clean up header * fix: chaining * refactor: handle error * fix e2e tests --------- Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
@@ -332,9 +332,7 @@ describe(`/oauth`, () => {
|
||||
const { status, body } = await request(app).post('/oauth/callback').send(callbackParams);
|
||||
expect(status).toBe(500);
|
||||
expect(body).toMatchObject({
|
||||
error: 'Internal Server Error',
|
||||
message: 'Failed to finish oauth',
|
||||
statusCode: 500,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -495,11 +493,10 @@ describe(`/oauth`, () => {
|
||||
});
|
||||
|
||||
it('should reject OAuth discovery over HTTP', async () => {
|
||||
const { status, body } = await request(app)
|
||||
const { status } = await request(app)
|
||||
.post('/oauth/authorize')
|
||||
.send({ redirectUri: 'http://127.0.0.1:2285/auth/login' });
|
||||
expect(status).toBe(500);
|
||||
expect(body).toMatchObject({ statusCode: 500 });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user