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

Add Keycloak #153

Merged
merged 98 commits into from
Apr 2, 2024
Merged

Add Keycloak #153

merged 98 commits into from
Apr 2, 2024

Conversation

gf-rog
Copy link
Collaborator

@gf-rog gf-rog commented Mar 22, 2024

Closes #31.
Some things have changed, most notably:

  1. Backend user's business logic was moved to backend/src/users.ts for better readability and reuse
  2. Backend is now an ES module instead of using CommonJS. The most important aspect of this change to keep in mind is that Typescript imports now have to end in .js.
  3. Keycloak is running in its own container named keycloak. It has to be run in development if the user provider in frontend/main.tsx is set to <KeycloakUserProvider>.
  4. Initial users are still registered using the old system (let me know if I should change this). For now a test Keycloak user is created with mail [email protected] and password password.
  5. The protected endpoints are wrapped in a <Protected> tag. It automatically redirects if the user is not logged in and allows for easy access of the logged in user without checking whether it's null first (useProtected context).

The frontend tests will have to be changed to test the Keycloak functionality. Maybe @Piterson25 could pull this branch and put his fixes there?

Let me know if any changes have to be made, I might have missed something obvious.

@gf-rog
Copy link
Collaborator Author

gf-rog commented Mar 25, 2024

I have noticed that in versions of Node above v18 the code doesn't run. I have decided to replace ts-node and nodemon with tsx and tsc-watch. The programming experience is practically the same, just using different tools.
I have also added a theme that resembles the main website. I'm not a graphic designer so any further changes should not be done by me.
All the users are added as Keycloak users since the old system is just for demonstration purposes and you could always register new users for testing.

@gf-rog gf-rog merged commit 5e3c07e into dev Apr 2, 2024
@Karol-2 Karol-2 deleted the keycloak branch April 24, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants