diff --git a/README.md b/README.md index dcb89b4..0acfaf8 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,21 @@ OTHER_VARIABLE=COOL-VALUE | KEYCLOAK_CLIENTSECRET | asdf1234qwerty67890 | | KEYCLOAK_REDIRECTURI | http://localhost:5173/auth/callback | +If you are using the docker compose to start the background services, use the following `.env` file + +``` dotenv +DATABASE_URL=postgresql://root:password@localhost:5432 +COOKIE_SECRET=9B36CD3E-78C9-47EF-9DAC-BC808C0C4E4F +KEYCLOAK_ENDPOINT=http://localhost:8080/realms/master +KEYCLOAK_CLIENTID= +KEYCLOAK_CLIENTSECRET= +KEYCLOAK_REDIRECTURI=http://localhost:5173/auth/callback +``` +replace `` and `` by going to `localhost:8080`, logging in, and creating a client. +For name, choose ``, then choose `client authentication`. +Make sure to add `Valid redirect URI` from above. +Find the `` by going to the client, and then credentials + ## Hacking To begin development on the service, start up the `compose.yml` using `docker compose up -d` for a database running at localhost at port 5432. diff --git a/app/routes/_main.tsx b/app/routes/_main.tsx index 7a0f8a1..6998ca8 100644 --- a/app/routes/_main.tsx +++ b/app/routes/_main.tsx @@ -58,7 +58,7 @@ function UserProfile() { - {user.name ?? user.email ?? 'Användare'} + {user.preferred_username ?? user.email ?? "Användare"} Settings diff --git a/compose.yml b/compose.yml index 5592190..65d4599 100644 --- a/compose.yml +++ b/compose.yml @@ -8,14 +8,18 @@ services: - db_data:/var/lib/postgresql/data ports: - 5432:5432 - + auth: image: quay.io/keycloak/keycloak:latest command: start-dev environment: KEYCLOAK_ADMIN: admin KEYCLOAK_ADMIN_PASSWORD: admin + volumes: + - keycloak_data:/opt/keycloak/data/import ports: - 8080:8080 + volumes: db_data: + keycloak_data: