-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added Auth react context #91
Changes from 5 commits
f2c8717
6cdf4e8
d8101a2
6b3a65a
0834f05
5473cf1
5da46ca
a8cf67e
c52e9ab
b9847fe
775344e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"react-router-dom": "^6.24.1", | ||
"react-supabase": "^0.2.0", | ||
"swr": "^2.2.5" | ||
}, | ||
"devDependencies": { | ||
|
@@ -36,6 +37,7 @@ | |
"ts-node": "^10.9.2", | ||
"typescript": "^5.5.2", | ||
"vite": "^5.3.1", | ||
"vite-plugin-string": "^1.2.3", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did you add this? what is it for? |
||
"vite-tsconfig-paths": "^4.3.2" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
"जैठा तक दमल ड छोक ऐठा तक जाईस, आगुबिती जलेसे दमाल ड ऐठा जाए हुना दख्बो","Walk as far as you can see the road, The way forward is visible after reaching there" | ||
"सफलतर सुरुवत सबै दिन आसफलतारसे हल्कु","Success always begins with failure" | ||
"जैला ठिक हो ऐला करिस, जैला सजिलो लगेसोक ऐल ना करिस","Do what is right, not what is easy" | ||
"जैला जीवन डक समयर महत्व रखेसेक ओईला आप्नाई आप्नाक जनेसेक","The one who has accepted the time in life has known himself" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import { | |
import User_auth from "./components/userAuth/UserAuth"; | ||
import Home from "./pages/Home/Home"; | ||
import supabase from "./components/userAuth/supabaseClient"; | ||
import { UserProvider } from "./components/userAuth/UserContext"; | ||
|
||
const App: React.FC = () => { | ||
const [isAuthenticated, setIsAuthenticated] = useState(false); | ||
|
@@ -36,18 +37,20 @@ const App: React.FC = () => { | |
}, []); | ||
|
||
return ( | ||
<Router> | ||
<Routes> | ||
<Route path="/login" element={<User_auth />} /> | ||
{/* Protect the / route, redirect to /login if not authenticated */} | ||
<Route | ||
path="/" | ||
element={isAuthenticated ? <Home /> : <Navigate to="/login" />} | ||
/> | ||
{/* Default route redirects to /login */} | ||
<Route path="/" element={<Navigate to="/login" />} /> | ||
</Routes> | ||
</Router> | ||
<UserProvider> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome!! |
||
<Router> | ||
<Routes> | ||
<Route path="/login" element={<User_auth />} /> | ||
{/* Protect the / route, redirect to /login if not authenticated */} | ||
<Route | ||
path="/" | ||
element={isAuthenticated ? <Home /> : <Navigate to="/login" />} | ||
/> | ||
{/* Default route redirects to /login */} | ||
<Route path="/" element={<Navigate to="/login" />} /> | ||
</Routes> | ||
</Router> | ||
</UserProvider> | ||
); | ||
}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you still using react-supabase? You can run
pnpm remove react-supabase
to get rid of it if you don't need it anymorehttps://chatgpt.com/share/04fc4457-0e8f-40f1-b135-e59fe0c94d16