function validateAuthToken() {
  const authToken = localStorage.getItem('authToken');
  if (authToken) {
    const decodedToken = jwtDecode(authToken);
    if (new Date() <= new Date(decodedToken.exp * 1000)) return authToken;
  }
  return null;
}
// store if it exists and is valid

store if it exists and is valid
store if it exists and is valid
function validateAuthToken() {
  const authToken = localStorage.getItem('authToken');
  if (authToken) {
    const decodedToken = jwtDecode(authToken);
    if (new Date() <= new Date(decodedToken.exp * 1000)) return authToken;
  }
  return null;
}
function validateAuthToken ( ) { const authToken = localStorage . getItem ( 'authToken' ) ; if ( authToken ) { const decodedToken = jwtDecode ( authToken ) ; if ( new Date ( ) <= new Date ( decodedToken . exp * 1000 ) ) return authToken ; } return null ; }
store if it exists and is valid
store if it exists and is valid