-
Notifications
You must be signed in to change notification settings - Fork 0
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
Features/ban unban #27
Conversation
Add databases and docker CD
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.
ALEXIS TU AS PRIS LA MAUVAISE BRANCHE 😡😡😡
backend/controllers/Account.ts
Outdated
const { email } = req.body; | ||
|
||
const isDevinciEmail = (email: string): boolean => { | ||
const expression: RegExp = /^[a-zA-Z0-9._-]+@edu\.devinci.fr$/; |
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.
Il manque un \ sur le point
// Regex actuel
const expression: RegExp = /^[a-zA-Z0-9._-]+@edu\.devinci.fr$/;
// Regex juste
const expression: RegExp = /^[a-zA-Z0-9._-]+@edu\.devinci\.fr$/;
backend/controllers/Account.ts
Outdated
@@ -22,6 +35,44 @@ class AccountController { | |||
* * Send a success message | |||
* * Send an error message if the email is invalid | |||
*/ | |||
const { email } = req.body; | |||
|
|||
const isDevinciEmail = (email: string): boolean => { |
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.
pas besoin de faire une fonction si elle n'est utilisé qu'une fois
backend/controllers/Account.ts
Outdated
return expression.test(email); | ||
}; | ||
|
||
if (isDevinciEmail(email) == true) { |
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.
pas besoin de sur-vérifié la boolean if (isDevinciEmail(email)) {
suffit
backend/controllers/Account.ts
Outdated
const link: string = `url/login?token=${token}`; | ||
|
||
const transporter = nodemailer.createTransport({ | ||
host: "your_host", |
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.
plus judicieux de mettre une variable d'environnement (exemple. process.env.MAIL_HOST
) ce qui simplifie aussi le test du code en local
backend/controllers/Account.ts
Outdated
port: 587, | ||
secure: true, | ||
auth: { | ||
user: "your_email_address", |
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
backend/controllers/Account.ts
Outdated
secure: true, | ||
auth: { | ||
user: "your_email_address", | ||
pass: "your_email_password", |
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
backend/controllers/Account.ts
Outdated
}); | ||
|
||
const message = { | ||
from: "your_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.
same
No description provided.