mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Compare commits
No commits in common. "55156de5f954c0daed8b7559b8da5acf0aebea06" and "9f4414f68c574c2790609801d6c864905d7127c5" have entirely different histories.
55156de5f9
...
9f4414f68c
3 changed files with 5 additions and 13 deletions
|
|
@ -72,10 +72,9 @@ const SimpleLogin: React.FC = () => {
|
|||
|
||||
<div className="login-links">
|
||||
|
||||
|
||||
{/* <Link to="/resetPassword"> */}
|
||||
<del>Réinitialiser le mot de passe</del>
|
||||
{/* </Link> */}
|
||||
<Link to="/resetPassword">
|
||||
Réinitialiser le mot de passe
|
||||
</Link>
|
||||
|
||||
<Link to="/register">
|
||||
Créer un compte
|
||||
|
|
|
|||
|
|
@ -165,7 +165,6 @@ class ApiService {
|
|||
* @returns A error string if unsuccessful,
|
||||
*/
|
||||
public async register(name: string, email: string, password: string, roles: string[]): Promise<any> {
|
||||
console.log(`ApiService.register: name: ${name}, email: ${email}, password: ${password}, roles: ${roles}`);
|
||||
try {
|
||||
|
||||
if (!email || !password) {
|
||||
|
|
@ -180,8 +179,7 @@ class ApiService {
|
|||
|
||||
console.log(result);
|
||||
if (result.status == 200) {
|
||||
//window.location.href = result.request.responseURL;
|
||||
window.location.href = '/login';
|
||||
window.location.href = result.request.responseURL;
|
||||
}
|
||||
else {
|
||||
throw new Error(`La connexion a échoué. Status: ${result.status}`);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ class SimpleAuth {
|
|||
}
|
||||
|
||||
async register(self, req, res) {
|
||||
console.log(`simpleauth.js.register: ${JSON.stringify(req.body)}`);
|
||||
try {
|
||||
let userInfos = {
|
||||
name: req.body.name,
|
||||
|
|
@ -35,11 +34,7 @@ class SimpleAuth {
|
|||
roles: req.body.roles
|
||||
};
|
||||
let user = await self.authmanager.register(userInfos)
|
||||
if (user) {
|
||||
return res.status(200).json({
|
||||
message: 'User created'
|
||||
});
|
||||
}
|
||||
if (user) res.redirect("/login")
|
||||
}
|
||||
catch (error) {
|
||||
return res.status(400).json({
|
||||
|
|
|
|||
Loading…
Reference in a new issue