-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add email to users #64
Conversation
You can proceed to update the auth too if you feel motivated. |
b1bfded
to
45a9e6b
Compare
Quality Gate passedIssues Measures |
6b857e4
to
fbefdfd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend fixing my feedback before merging.
@@ -4,7 +4,7 @@ import { build } from '../../../helper.js' | |||
import { FastifyInstance } from 'fastify' | |||
import { scryptHash } from '../../../../src/plugins/custom/scrypt.js' | |||
|
|||
async function createUser (app: FastifyInstance, userData: Partial<{ username: string; password: string }>) { | |||
async function createUser (app: FastifyInstance, userData: Partial<{ username: string; email: string; password: string }>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, email can be created dynamically.
const res = await this.inject({ | ||
method: 'POST', | ||
url: '/api/auth/login', | ||
payload: { | ||
username, | ||
email, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can automate the creation of the email from the username by doing '${username}@example.com'
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that first, but if the authentication should be based on email, wouldn't it be better if the tests reflected this?
If you pull the last changes, sonarcloud should not fail anymore. |
Quality Gate passedIssues Measures |
Thanks @EnzoDOROSARIO! |
Description
Prepare #49
Checklist
npm run test
andnpm run benchmark
and the Code of conduct