-
-
Notifications
You must be signed in to change notification settings - Fork 1
Vercel #2
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
Open
Long104
wants to merge
11
commits into
main
Choose a base branch
from
vercel
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Vercel #2
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
811a547
fix oauth
Long104 cb73e16
fix oauth
Long104 7c61910
try to do in local
Long104 33bfd21
remove Unnecessary
Long104 371743f
fix oauth
Long104 08bc6d4
update backend for oauth
Long104 8cb2aae
fix middleware ts
Long104 7589008
fix: pass JWT token as URL parameter for cross-domain OAuth redirect
Long104 cce9837
fix: pass JWT as URL param for OAuth redirect
Long104 9c5bafb
fix: CORS configuration to allow requests from frontend
Long104 324756a
fix: return proper types from fetch functions on error
Long104 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| GOOGLE_CLIENT_ID=your_google_client_id_here | ||
| GOOGLE_CLIENT_SECRET=your_google_client_secret_here | ||
| GITHUB_CLIENT_ID=your_github_client_id_here | ||
| GITHUB_CLIENT_SECRET=your_github_client_secret_here | ||
| jwtSecretKey=your_jwtsecretkey_here | ||
| DB_HOST=your_db_host_here | ||
| DB_USER=your_db_user_here | ||
| DB_PASSWORD=your_db_password_here | ||
| DB_NAME=your_db_name_here | ||
| DB_PORT=your_db_port_here | ||
| FRONTEND_URL=your_frontend_url_here | ||
| # FRONTEND_URL : http://cashwise.com | ||
| FRONTEND_URL=your_frontend_url_here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .vercel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| package handler | ||
|
|
||
| import ( | ||
| "net/http" | ||
|
|
||
| // "os" | ||
|
|
||
| "github.com/gofiber/fiber/v2" | ||
| "github.com/gofiber/fiber/v2/middleware/adaptor" | ||
|
|
||
| // jwtware "github.com/gofiber/jwt/v3" | ||
|
|
||
| "github.com/long104/SenZen/config" | ||
| "github.com/long104/SenZen/middleware" | ||
| "github.com/long104/SenZen/routes" | ||
| ) | ||
|
|
||
| // Handler is the main entry point of the application. | ||
| func Handler(w http.ResponseWriter, r *http.Request) { | ||
| // Set the proper request path in `*fiber.Ctx` | ||
| r.RequestURI = r.URL.String() | ||
| handler().ServeHTTP(w, r) | ||
| } | ||
| func handler() http.HandlerFunc { | ||
| config.ConnectDatabase() | ||
| app := fiber.New() | ||
|
|
||
| app.Use(middleware.CORSMiddleware()) | ||
|
|
||
| app.Get("api/health", func(c *fiber.Ctx) error { | ||
| return c.SendString("health check ok") | ||
| }) | ||
|
|
||
| routes.SetupOAuthRoutes(app) | ||
| routes.SetupAuthRoutes(app) | ||
|
|
||
| // app.Use(jwtware.New(jwtware.Config{ | ||
| // SigningKey: []byte(os.Getenv("jwtSecretKey")), | ||
| // })) | ||
|
|
||
| // app.Use("/admin", middleware.checkMiddleware) | ||
| // app.Use("/books", AuthRequired) | ||
| app.Get("api/validate-token", middleware.ValidateToken) | ||
|
|
||
| routes.SetupRoutes(app) | ||
|
|
||
| // setupRoutes(app) | ||
|
|
||
| // app.Listen(":8080") | ||
| return adaptor.FiberApp(app) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you are not using debugger. At least use a proper log message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry bro