router.get('/', passport.authenticate('microsoft', { }), function(req, res) { // The request will be redirected to Microsoft for authentication, so this // function will not be called. });router.get('/callback', passport.authenticate('microsoft', { failureRedirect: '/failure' }), function(req, res) { res.redirect(`http://localhost:5173/home/event-types?firstName=${req.user.firstName}`); });
router.get('/', passport.authenticate('microsoft', { }), function(req, res) { // The request will be redirected to Microsoft for authentication, so this // function will not be called. });router.get('/callback', passport.authenticate('microsoft', { failureRedirect: '/failure' }), function(req, res) { res.redirect(`http://localhost:5173/home/event-types?firstName=${req.user.firstName}`); });
req.user possibly 'undefined'
src/routes/microsoftRoutes.ts:30:70 - error TS18048: 'req.user' is possibly 'undefined'.30 res.redirect(`http://localhost:5173/home/event-types?firstName=${req.user.firstName`);src/routes/microsoftRoutes.ts:30:79 - error TS2339: Property 'firstName' does not exist on type 'User'.30 res.redirect(`http://localhost:5173/home/event-types?firstName=${req.user.firstName`)
src/routes/microsoftRoutes.ts:30:70 - error TS18048: 'req.user' is possibly 'undefined'.30 res.redirect(`http://localhost:5173/home/event-types?firstName=${req.user.firstName`);src/routes/microsoftRoutes.ts:30:79 - error TS2339: Property 'firstName' does not exist on type 'User'.30 res.redirect(`http://localhost:5173/home/event-types?firstName=${req.user.firstName`)