Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/server/src/api/auth/recover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default makeFastifyRoute(authRecoverPost, async ({ req, res }) => {

const user = await getUserByEmail({ email })
if (user === undefined) {
return res.badUnknownEmail()
return res.goodVerifySent()
}

const verifyUuid = uuidv4()
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/providers/uploads/local/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class LocalProvider implements Provider {
index: false,
setHeaders: (res: ServerResponse) => {
res.setHeader('cache-control', 'public, max-age=31557600, immutable')
res.setHeader('content-disposition', 'atttachment')
res.setHeader('content-disposition', 'attachment')
},
})
}
Expand Down
8 changes: 4 additions & 4 deletions packages/server/test/integration/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import * as database from '../../src/database'
import config from '../../src/config/server'
import {
badEmail,
badUnknownEmail,
badKnownEmail,
badKnownName,
goodRegister,
goodToken,
goodUserUpdate,
badRegistrationsDisabled,
goodVerifySent,
} from '@rctf/api-types/responses'

import * as auth from '../../src/auth'
Expand Down Expand Up @@ -45,7 +45,7 @@ test('fails with badEmail', async () => {
expect(resp.body.kind).toBe('badEmail')
})

test('fails with badUnknownEmail', async () => {
test('fails with goodVerifySent', async () => {
config.email = oldEmail

const unknownEmail = 'non-existent-email' + Math.random() + '@gmail.com'
Expand All @@ -54,9 +54,9 @@ test('fails with badUnknownEmail', async () => {
.send({
email: unknownEmail,
})
.expect(badUnknownEmail.status)
.expect(goodVerifySent.status)

expect(resp.body.kind).toBe('badUnknownEmail')
expect(resp.body.kind).toBe('goodVerifySent')
})

test('when not email, succeeds with goodRegister', async () => {
Expand Down