Answer the question
In order to leave comments, you need to log in
How to pass data to the front using passport-steam?
const { Router } = require('express')
const passport = require('passport')
const router = Router()
router.get('/steam', passport.authenticate('steam', {
failureRedirect: '/'
}))
router.get('/steam/return', passport.authenticate('steam', {
failureRedirect: '/'
}), (req, res) => {
console.log(req)
})
router.get('/isLogged', (req, res) => {
res.status(200).json(req.headers)
})
module.exports = router
Answer the question
In order to leave comments, you need to log in
If the token is passed via hash (#), then using JS you can store the token in localStorage and redirect to the desired page. And from it already take a token from localStorage. The lifetime of the token can also be written to localStorage and simply checked against the real time each time.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question