Skip to content
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

Feat/cli next/solid #132

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1b3fb55
feat: config updates
DBozhinovski Dec 16, 2024
7b2e891
feat: changes based on Isaiah`s feedback
DBozhinovski Dec 16, 2024
0577145
feat: simplifies even further
DBozhinovski Dec 16, 2024
4d0b072
feat: further CSS simplifications. UI too.
DBozhinovski Dec 16, 2024
3ed336e
feat: port style changes over to Solid
DBozhinovski Dec 16, 2024
f583523
feat: moves stuff around to make it more consistent with react
DBozhinovski Dec 16, 2024
b6b7315
feat: ports style, routes and general layout from react to solid
DBozhinovski Dec 16, 2024
2feb939
feat: fixes recipes
DBozhinovski Dec 16, 2024
62bccda
feat: updates solid readme
DBozhinovski Dec 16, 2024
6ca47cf
docs: updates examples in readme
DBozhinovski Dec 17, 2024
34fb001
feat: astro changes
DBozhinovski Dec 17, 2024
5c1a585
feat: moves astro to astro build-pretty; adds working astro revision
DBozhinovski Dec 17, 2024
5252f7d
chore: cleanup and raedme update
DBozhinovski Dec 17, 2024
96d01b8
fix: removes middleware; updates sessioninfo path
DBozhinovski Dec 17, 2024
aeb4a2c
feat: adds vanilla astro
DBozhinovski Dec 17, 2024
efe6ff3
feat: misc fixes on react - vanilla Astro port
DBozhinovski Dec 17, 2024
7f85b13
feat: adds session check for dashboard in vanilla astro
DBozhinovski Dec 18, 2024
16d8f1a
feat: updated vanilla astro readme; removes unused files
DBozhinovski Dec 18, 2024
a41f7ae
chore: changes redirection url to /dashboard across all updated scafo…
DBozhinovski Dec 18, 2024
1ee14e4
feat: config dashboard redirection fix; react auth state on home screen
DBozhinovski Dec 18, 2024
2b50a07
feat: adds home logic changes to astro-react
DBozhinovski Dec 18, 2024
aa8233e
feat: adds vanilla astro home logic changes
DBozhinovski Dec 18, 2024
64df9cd
feat: sveltekit review
DBozhinovski Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions boilerplate/frontend/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ This project aims to demonstrate how to integrate SuperTokens into a React appli
┃ ┣ 📜guide-icon.svg
┃ ┣ 📜separator-line.svg
┃ ┗ 📜signout-icon.svg
┣ 📂Home --> "Dashboard" component, accessible only via the logged-in state of the app
┃ ┣ 📜CallAPIView.tsx
┃ ┣ 📜Home.css
┃ ┣ 📜SuccessView.tsx
┣ 📂Dashboard --> Protected route component, only accessible to authenticated users
┃ ┗ 📜index.tsx
┣ 📂Home --> Public landing page component, accessible regardless of auth state
┃ ┗ 📜index.tsx
┣ 📜App.css
┣ 📜App.tsx --> Root component of the app
┣ 📜config.tsx --> SuperTokens configuration
┣ 📜vite-env.d.ts
┗ 📜main.tsx --> Entry point of the app
```

Expand Down Expand Up @@ -70,17 +71,12 @@ The application uses [React Router](https://reactrouter.com/) for routing and co

- Public landing page accessible to all users
- Provides navigation to authentication and dashboard
- Displays basic application information and links
- Serves as the entry point for new users

4. **Dashboard Component (`/dashboard` route, `/Dashboard/index.tsx` component)**
- Protected route only accessible to authenticated users
- Protected by `SessionAuth` component
- Displays user information and session details
- Provides functionality to:
- View user ID
- Call test API endpoints
- Access documentation
- Sign out
- Displays user information and provides authenticated functionality

When a user visits the application, they start at the home page (`/`). They can choose to authenticate through the `/auth` route, and once authenticated, they gain access to the protected dashboard. The session state is managed throughout the application using SuperTokens' session management.

Expand Down
3 changes: 2 additions & 1 deletion boilerplate/frontend/react/config/all_auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ export const SuperTokensConfig = {
Session.init(),
],
getRedirectionURL: async (context) => {
if (context.action === "SUCCESS" && context.newSessionCreated) {
if (context.action === "SUCCESS") {
return "/dashboard";
}
return undefined;
},
};

Expand Down
3 changes: 2 additions & 1 deletion boilerplate/frontend/react/config/emailpassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ export const SuperTokensConfig = {
// use from SuperTokens. See the full list here: https://supertokens.com/docs/guides
recipeList: [EmailPassword.init(), Session.init()],
getRedirectionURL: async (context) => {
if (context.action === "SUCCESS" && context.newSessionCreated) {
if (context.action === "SUCCESS") {
return "/dashboard";
}
return undefined;
},
};

Expand Down
3 changes: 2 additions & 1 deletion boilerplate/frontend/react/config/multifactorauth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ export const SuperTokensConfig = {
Session.init(),
],
getRedirectionURL: async (context) => {
if (context.action === "SUCCESS" && context.newSessionCreated) {
if (context.action === "SUCCESS") {
return "/dashboard";
}
return undefined;
},
};

Expand Down
3 changes: 2 additions & 1 deletion boilerplate/frontend/react/config/passwordless.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ export const SuperTokensConfig = {
Session.init(),
],
getRedirectionURL: async (context) => {
if (context.action === "SUCCESS" && context.newSessionCreated) {
if (context.action === "SUCCESS") {
return "/dashboard";
}
return undefined;
},
};

Expand Down
3 changes: 2 additions & 1 deletion boilerplate/frontend/react/config/thirdparty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ export const SuperTokensConfig = {
Session.init(),
],
getRedirectionURL: async (context) => {
if (context.action === "SUCCESS" && context.newSessionCreated) {
if (context.action === "SUCCESS") {
return "/dashboard";
}
return undefined;
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ export const SuperTokensConfig = {
Session.init(),
],
getRedirectionURL: async (context) => {
if (context.action === "SUCCESS" && context.newSessionCreated) {
if (context.action === "SUCCESS") {
return "/dashboard";
}
return undefined;
},
};

Expand Down
3 changes: 2 additions & 1 deletion boilerplate/frontend/react/config/thirdpartypasswordless.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ export const SuperTokensConfig = {
Session.init(),
],
getRedirectionURL: async (context) => {
if (context.action === "SUCCESS" && context.newSessionCreated) {
if (context.action === "SUCCESS") {
return "/dashboard";
}
return undefined;
},
};

Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions boilerplate/frontend/react/public/assets/images/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import SeparatorLine from "./separator-line.svg";
import ArrowRight from "./arrow-right-icon.svg";
import SignOutIcon from "./sign-out-icon.svg";
import GuideIcon from "./guide-icon.svg";
import BlogsIcon from "./blogs-icon.svg";
import CelebrateIcon from "./celebrate-icon.svg";

export { SeparatorLine, ArrowRight, SignOutIcon, GuideIcon, BlogsIcon, CelebrateIcon };
10 changes: 10 additions & 0 deletions boilerplate/frontend/react/public/assets/images/separator-line.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading