Skip to content
Snippets Groups Projects

Fix/authorization

Merged Defendi Alberto requested to merge fix/authorization into dev
1 file
+ 3
3
Compare changes
  • Side-by-side
  • Inline
+ 3
3
@@ -8,11 +8,11 @@ import { useEffect, useState } from 'react';
* @returns {boolean | null} isAuth: true if user is authenticated, false otherwise or null if the request has not finished.
*/
export const useAuth = (): [
boolean,
React.Dispatch<React.SetStateAction<boolean>>,
boolean | null,
React.Dispatch<React.SetStateAction<boolean | null>>,
] => {
let isMounted = true;
const [isAuth, setIsAuth] = useState<boolean>(false);
const [isAuth, setIsAuth] = useState<boolean | null>(null);
useEffect(() => {
isAuthenticated().then((state) => {
if (isMounted) {
Loading