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

fixed auth callback url #22

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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