Skip to content

Commit

Permalink
feat: disable auth for browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Rassl committed Aug 2, 2024
1 parent 5ebee6f commit 2c5f950
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/components/Auth/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ export const AuthGuard = ({ children }: PropsWithChildren) => {

await updateBudget(setBudget)

if (isE2E || isDevelopment) {
setIsAuthenticated(true)
}
}, [setBudget, setPubKey, setIsAuthenticated])

const handleIsAdmin = useCallback(async () => {
try {
const res = await getIsAdmin()

Expand All @@ -77,13 +83,7 @@ export const AuthGuard = ({ children }: PropsWithChildren) => {
} catch (error) {
/* not an admin */
}

if (isE2E || isDevelopment) {
setIsAuthenticated(true)
}
}, [
setBudget,
setPubKey,
setIsAuthenticated,
setIsAdmin,
setTrendingTopicsFeatureFlag,
Expand All @@ -95,12 +95,16 @@ export const AuthGuard = ({ children }: PropsWithChildren) => {

// auth checker
useEffect(() => {
if (!isWebView() && !isE2E && false) {
return
const init = async () => {
if (isWebView() || isE2E) {
await handleAuth()
}

await handleIsAdmin()
}

handleAuth()
}, [handleAuth])
init()
}, [handleAuth, handleIsAdmin])

const message = 'This is a private Graph, Contact Admin'

Expand Down

0 comments on commit 2c5f950

Please sign in to comment.