Skip to content

Commit

Permalink
frontend: disable subscription requirement for now
Browse files Browse the repository at this point in the history
  • Loading branch information
NickSavage committed Oct 6, 2024
1 parent 9f1b2a8 commit 075a853
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions zettelkasten-front/src/contexts/AuthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const AuthProvider = ({ children }: AuthProviderProps) => {
const [isAuthenticated, setIsAuthenticated] = useState(false);
const [isAdmin, setIsAdmin] = useState(false);
const [isLoading, setIsLoading] = useState(true); // Added loading state
const [hasSubscription, setHasSubscription] = useState<boolean>(false);
const [hasSubscription, setHasSubscription] = useState<boolean>(true);
const [currentUser, setCurrentUser] = useState<User | null>(null);

useEffect(() => {
Expand All @@ -45,7 +45,8 @@ export const AuthProvider = ({ children }: AuthProviderProps) => {
const currentUser = await getCurrentUser();
setCurrentUser(currentUser);
console.log("user", currentUser)
setHasSubscription(currentUser.stripe_subscription_status === "active");
// setHasSubscription(currentUser.stripe_subscription_status === "active");
setHasSubscription(true)
}
setIsLoading(false);
};
Expand All @@ -56,7 +57,8 @@ export const AuthProvider = ({ children }: AuthProviderProps) => {
const loginUser = (data: LoginResponse) => {
localStorage.setItem("token", data["access_token"]);
localStorage.setItem("username", data["user"]["username"]);
setHasSubscription(data["user"].stripe_subscription_status === "active");
setHasSubscription(true);
// setHasSubscription(data["user"].stripe_subscription_status === "active");
setIsAuthenticated(true);
};

Expand Down

0 comments on commit 075a853

Please sign in to comment.