Skip to content

Commit

Permalink
feat/webapp-nextjs: authorization with auth0
Browse files Browse the repository at this point in the history
  • Loading branch information
tonitienda committed Mar 29, 2024
1 parent be91146 commit c3376f1
Show file tree
Hide file tree
Showing 24 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-run-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
- name: Build Golang Rest Backend Docker image
run: docker build -t backend-golang-rest backend-golang-rest
- name: Build React WebApp Docker image
run: docker build -t webapp-react webapp-react
run: docker build -t webapp-nextjs webapp-nextjs
2 changes: 1 addition & 1 deletion docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ services:
build:
target: build
volumes:
- ./webapp-react:/app
- ./webapp-nextjs:/app
command: npm run dev
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
- .env
webapp:
build:
context: ./webapp-react
context: ./webapp-nextjs
dockerfile: Dockerfile
ports:
- 3000:3000
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test-coverage:
cd backend-golang-rest && go tool cover -html=coverage.out -o coverage.html

start-frontend:
cp .env webapp-react/.env.local
cd webapp-react && BACKEND_BASE_URL="http://localhost:8080" npm run dev
cp .env webapp-nextjs/.env.local
cd webapp-nextjs && BACKEND_BASE_URL="http://localhost:8080" npm run dev


File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 20 additions & 2 deletions webapp-react/package-lock.json → webapp-nextjs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion webapp-react/package.json → webapp-nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "webapp-react",
"name": "webapp-nextjs",
"version": "0.1.0",
"private": true,
"scripts": {
Expand All @@ -9,6 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@auth0/auth0-react": "^2.2.4",
"@auth0/nextjs-auth0": "^3.5.0",
"@emotion/cache": "^11.11.0",
"@emotion/react": "^11.11.4",
Expand Down
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ function buildUrl(path: string) {
}

export async function getTasks() {
const accessTokenResponse = await getAccessToken({});
const accessTokenResponse = await getAccessToken({
authorizationParams: {
audience: process.env.AUTH0_AUDIENCE || "",
},
});

const res = await fetch(buildUrl("/v0/tasks"), {
cache: "no-store",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c3376f1

Please sign in to comment.