-
-
Notifications
You must be signed in to change notification settings - Fork 160
Made the profile section dynamic #98
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
Changes from all commits
e40dd36
39b3c2b
010c1ac
1eb44fd
255d94a
f6c866b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,9 +32,10 @@ type Config struct { | |||||||||||||||||||||||
| } `yaml:"database"` | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| JWT struct { | ||||||||||||||||||||||||
| Secret string // Add JWT secret | ||||||||||||||||||||||||
| Expiry int // Token expiry in minutes | ||||||||||||||||||||||||
| Secret string `yaml:"secret"` | ||||||||||||||||||||||||
| Expiry int `yaml:"expiry"` | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
Comment on lines
34
to
37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add missing YAML struct tag for JWT configuration. The JWT struct is missing the JWT struct {
Secret string `yaml:"secret"`
Expiry int `yaml:"expiry"`
- }
+ } `yaml:"jwt"`📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| SMTP struct { // Add SMTP configuration | ||||||||||||||||||||||||
| Host string | ||||||||||||||||||||||||
| Port int | ||||||||||||||||||||||||
|
|
@@ -43,8 +44,8 @@ type Config struct { | |||||||||||||||||||||||
| SenderEmail string // Same as Username for Gmail | ||||||||||||||||||||||||
| SenderName string | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| GoogleOAuth struct { // Add Google OAuth configuration | ||||||||||||||||||||||||
| ClientID string | ||||||||||||||||||||||||
| GoogleOAuth struct { | ||||||||||||||||||||||||
| ClientID string `yaml:"clientID"` | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
Comment on lines
+47
to
50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add missing YAML struct tag for GoogleOAuth configuration. The GoogleOAuth struct is missing the GoogleOAuth struct {
ClientID string `yaml:"clientID"`
- }
+ } `yaml:"googleOAuth"`📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| server: | ||
| port: 1313 # The port number your backend server will run on | ||
|
|
||
| database: | ||
| uri: 'mongodb+srv://<username>:<password>@<cluster-url>/<database-name>' | ||
| # Replace with your MongoDB Atlas connection string | ||
| # Get this from your MongoDB Atlas dashboard after creating a cluster and database | ||
|
|
||
| gemini: | ||
| apiKey: '<YOUR_GEMINI_API_KEY>' | ||
| # API key for OpenAI / Gemini model access | ||
| # Obtain from your OpenRouter.ai or OpenAI account dashboard | ||
|
|
||
| jwt: | ||
| secret: '<YOUR_JWT_SECRET>' | ||
| # A secret string used to sign JWT tokens | ||
| # Generate a strong random string (e.g. use `openssl rand -hex 32`) | ||
|
|
||
| expiry: 1440 | ||
| # Token expiry time in minutes (e.g. 1440 = 24 hours) | ||
|
|
||
| smtp: | ||
| host: 'smtp.gmail.com' | ||
| # SMTP server host for sending emails (example is Gmail SMTP) | ||
|
|
||
| port: 587 | ||
| # SMTP server port (587 for TLS) | ||
|
|
||
| username: '<YOUR_EMAIL_ADDRESS>' | ||
| # Email username (your email address) | ||
|
|
||
| password: '<YOUR_EMAIL_PASSWORD_OR_APP_PASSWORD>' | ||
| # Password for the email or app-specific password if 2FA is enabled | ||
|
|
||
| senderEmail: '<YOUR_EMAIL_ADDRESS>' | ||
| # The 'from' email address used when sending mails | ||
|
|
||
| senderName: 'DebateAI Team' | ||
|
|
||
| googleOAuth: | ||
| clientID: '<YOUR_GOOGLE_OAUTH_CLIENT_ID>' | ||
| # Google OAuth Client ID for OAuth login | ||
| # Obtain from Google Cloud Console (APIs & Services > Credentials > OAuth 2.0 Client IDs) |
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.
💡 Verification agent
🧩 Analysis chain
Verify the configuration structure supports JWT.Secret field.
The JWT secret initialization looks correct and is well-placed after DB connection. Please ensure the config structure includes the JWT.Secret field.
🏁 Script executed:
Length of output: 598
To confirm the
Configstruct’s definition and ensure it includes theJWT.Secretfield, let’s locate its declaration in the codebase:🏁 Script executed:
Length of output: 1102
Add missing JWT field to the Config struct
The
Configstruct inbackend/config/config.godoes not define aJWTsection, socfg.JWT.Secretwill not be populated. Please update the struct to include it:• File:
backend/config/config.go, insidetype Config struct { … }type Config struct { Server struct { Port int `yaml:"port"` } `yaml:"server"` Cognito struct { … } `yaml:"cognito"` Openai struct { … } `yaml:"openai"` Gemini struct { … } `yaml:"gemini"` Database struct { … } `yaml:"database"` + JWT struct { + Secret string `yaml:"secret"` + Expiry int `yaml:"expiry"` // if you also want to capture token expiry + } `yaml:"jwt"` }• Ensure your YAML config (e.g.
backend/config/config.prod.yml) remains:After this change,
utils.SetJWTSecret(cfg.JWT.Secret)will correctly receive the configured value.🤖 Prompt for AI Agents