diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..dc0bdbd3 --- /dev/null +++ b/.env.example @@ -0,0 +1,15 @@ +BACKEND_PORT=3300 +# Database +POSTGRES_USER=postgres +POSTGRES_PASSWORD=postgres +POSTGRES_DB=schbody +POSTGRES_PORT=5432 +DATABASE_URL=postgresql://postgres:postgres@localhost:5432/schbody?schema=public +#Jwt +JWT_SECRET="this is a secret" +#AuthSch +AUTHSCH_CLIENT_ID="" +AUTHSCH_CLIENT_SECRET="" +#Frontend +FRONTEND_URL="http://localhost:3000" +FRONTEND_AUTHORIZED_URL=http://localhost:3000/auth/callback diff --git a/apps/backend/.env.example b/apps/backend/.env.example index d2ca2162..abc3b1d3 100644 --- a/apps/backend/.env.example +++ b/apps/backend/.env.example @@ -3,4 +3,5 @@ AUTHSCH_CLIENT_ID="16873903969434023692" AUTHSCH_CLIENT_SECRET="5KhIlDHGhxzLx3FK7L81FJ5CQSuyJTLVrW0hZnbzv4jbdOHU255HuOtBgGZS38V3pHGd4SE78aq4Njze" JWT_SECRET="this is a secret" FRONTEND_URL="http://localhost:3000" +FRONTEND_AUTHORIZED_URL=http://localhost:3000/auth/callback BACKEND_PORT=3300 diff --git a/apps/backend/src/auth/auth.controller.ts b/apps/backend/src/auth/auth.controller.ts index 8c532c9f..9527d06f 100644 --- a/apps/backend/src/auth/auth.controller.ts +++ b/apps/backend/src/auth/auth.controller.ts @@ -28,7 +28,7 @@ export class AuthController { oauthRedirect(@CurrentUser() user: User) { const jwt = this.authService.login(user); return { - url: `${process.env.FRONTEND_URL}?jwt=${jwt}`, + url: `${process.env.FRONTEND_AUTHORIZED_URL}?jwt=${jwt}`, }; } @Get('me')