Skip to content

Commit

Permalink
remove ResetTokenTTL
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Jun 29, 2024
1 parent 7ba386f commit bb97ef1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
1 change: 0 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ JWT_SECRET=secret
JWT_ACCESS_TTL=3600
JWT_REFRESH_TTL=259200
JWT_ISSUER=issuer
JWT_RESET_TOKEN_TTL=900

OAUTH_CLIENT_ID=client_id
OAUTH_CLIENT_SECRET=client_secret
Expand Down
22 changes: 8 additions & 14 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ type RedisConfig struct {
}

type JwtConfig struct {
Secret string
AccessTTL int
RefreshTTL int
Issuer string
ResetTokenTTL int
Secret string
AccessTTL int
RefreshTTL int
Issuer string
}

type OauthConfig struct {
Expand Down Expand Up @@ -82,17 +81,12 @@ func LoadConfig() (*Config, error) {
if err != nil {
return nil, err
}
resetTokenTTL, err := strconv.ParseInt(os.Getenv("JWT_RESET_TOKEN_TTL"), 10, 64)
if err != nil {
return nil, err
}

jwtConfig := JwtConfig{
Secret: os.Getenv("JWT_SECRET"),
AccessTTL: int(accessTTL),
RefreshTTL: int(refreshTTL),
Issuer: os.Getenv("JWT_ISSUER"),
ResetTokenTTL: int(resetTokenTTL),
Secret: os.Getenv("JWT_SECRET"),
AccessTTL: int(accessTTL),
RefreshTTL: int(refreshTTL),
Issuer: os.Getenv("JWT_ISSUER"),
}

oauthConfig := OauthConfig{
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.qa.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
# APP_PORT: 3002
# APP_ENV: development
# DB_URL: postgres://root:1234@db:5432/rpkm67_db
# REDIS_HOST: localhost
# REDIS_HOST: cache
# REDIS_PORT: 6379
# REDIS_PASSWORD: 5678
# JWT_SECRET: secret
Expand Down

0 comments on commit bb97ef1

Please sign in to comment.