message: Added utility extra field to auth context
diff: @@ -76,6 +76,16 @@ export interface AuthController {
  */
  signOut: () => void;
  + /**
  + * Utility field you can use to store your custom data.
  + * e.g: Additional user data fetched from a Firestore document
  + */
  + extra?: any;
  +
  + /**
  + * Set extra
  + */
  + setExtra: (extra: any) => void;
  }
  export const AuthContext = React.createContext<AuthController>({
  @@ -95,6 +105,8 @@ export const AuthContext = React.createContext<AuthController>({
  skipLogin: () => {
  },
  signOut: () => {
  + },
  + setExtra: (extra: any) => {
  }
  });
  @@ -123,7 +135,7 @@ interface AuthHandlerProps {
  export const useAuthHandler = (
  {
  - authentication,
  + authentication
  }: AuthHandlerProps): AuthController => {
  const [loggedUser, setLoggedUser] = React.useState<firebase.User | null>(null);
  @@ -133,6 +145,7 @@ export const useAuthHandler = (
  const [authResult, setAuthResult] = React.useState<any>();
  const [loginSkipped, setLoginSkipped] = React.useState<boolean>(false);
  const [notAllowedError, setNotAllowedError] = React.useState<boolean>(false);
  + const [extra, setExtra] = React.useState<any>();
  useEffect(() => {
  return firebase.auth().onAuthStateChanged(
  @@ -191,6 +204,8 @@ export const useAuthHandler = (
  skipLogin,
  signOut,
  canAccessMainView,
  + extra,
  + setExtra
  };
  };
  