Skip to content

Commit

Permalink
Merge pull request #22 from kir-dev/fix/auth-callback-url
Browse files Browse the repository at this point in the history
fixed auth callback url
  • Loading branch information
FearsomeRover authored Aug 20, 2024
2 parents 652bd0a + bea3ab7 commit a61d7cb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions apps/backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion apps/backend/src/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit a61d7cb

Please sign in to comment.