mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
fix login error + auth callback
This commit is contained in:
parent
ddc33bb6ac
commit
d7986447c4
3 changed files with 6 additions and 2 deletions
|
|
@ -1,3 +1,5 @@
|
|||
process.env['base']
|
||||
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import App from './App.tsx';
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class AuthManager{
|
|||
|
||||
async login(userInfo,req,res,next){
|
||||
const tokenToSave = jwt.create(userInfo.email, userInfo._id);
|
||||
res.redirect(`/auth/callback?user=${tokenToSave}`);
|
||||
res.redirect(`${process.env['FRONTEND_URL']}/auth/callback?user=${tokenToSave}`);
|
||||
console.info(`L'utilisateur '${userInfo.name}' vient de se connecter`)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,9 @@ class SimpleAuth{
|
|||
self.authmanager.login(user,req,res,next)
|
||||
}
|
||||
catch (error) {
|
||||
return next(error);
|
||||
return res.status(400).json({
|
||||
message: error.message
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue