This commit is contained in:
aditya.siregar
2025-04-26 12:23:12 +07:00
parent 09c9a4d59d
commit 06d7b4764f
32 changed files with 581 additions and 208 deletions
+4
View File
@@ -82,5 +82,9 @@ func (c *Config) Auth() *AuthConfig {
secret: c.Jwt.TokenWithdraw.Secret,
expireTTL: c.Jwt.TokenWithdraw.ExpiresTTL,
},
jwtCustomer: JWT{
secret: c.Jwt.TokenCustomer.Secret,
expireTTL: c.Jwt.TokenCustomer.ExpiresTTL,
},
}
}
+5
View File
@@ -9,6 +9,7 @@ type AuthConfig struct {
jwtOrderExpiresTTL int
jwtSecretResetPassword JWT
jwtWithdraw JWT
jwtCustomer JWT
}
type JWT struct {
@@ -24,6 +25,10 @@ func (c *AuthConfig) AccessTokenOrderSecret() string {
return c.jwtOrderSecret
}
func (c *AuthConfig) AccessTokenCustomerSecret() string {
return c.jwtCustomer.secret
}
func (c *AuthConfig) AccessTokenWithdrawSecret() string {
return c.jwtWithdraw.secret
}
+1
View File
@@ -5,6 +5,7 @@ type Jwt struct {
TokenOrder Token `mapstructure:"token-order"`
TokenResetPassword Token `mapstructure:"token-reset-password"`
TokenWithdraw Token `mapstructure:"token-withdraw"`
TokenCustomer Token `mapstructure:"token-customer"`
}
type Token struct {