mirror of
https://github.com/franjsco/tick3t
synced 2024-12-26 17:33:27 +01:00
refactor: localStorage -> sessionStorage
This commit is contained in:
parent
50f3ae582b
commit
5c05e84ccc
@ -6,7 +6,7 @@ export const PrivateRoute = ({ component: Component, ...rest }) => {
|
||||
<Route
|
||||
{...rest}
|
||||
render={props => (
|
||||
localStorage.getItem('user')
|
||||
sessionStorage.getItem('user')
|
||||
? <Component {...props} />
|
||||
: <Redirect to={{ pathname: '/login', state: { from: props.location }}} />
|
||||
)}
|
||||
|
@ -1,5 +1,5 @@
|
||||
export function authHeader() {
|
||||
let user = JSON.parse(localStorage.getItem('user'));
|
||||
let user = JSON.parse(sessionStorage.getItem('user'));
|
||||
|
||||
if (user.data.token) {
|
||||
return `Bearer ${user.data.token}` ;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { userConstants } from '../_constants/user.constants';
|
||||
|
||||
let userLocalStorage = JSON.parse(localStorage.getItem('user'));
|
||||
let userLocalStorage = JSON.parse(sessionStorage.getItem('user'));
|
||||
|
||||
const initialState = userLocalStorage ? {loggedIn: true} : {loggedIn: false};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user