Return tokens in the message body
All checks were successful
ci/woodpecker/push/build Pipeline was successful

Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
This commit is contained in:
2026-05-27 13:54:32 +02:00
parent a9784c3436
commit 08087d453f
6 changed files with 25 additions and 28 deletions

View File

@@ -38,7 +38,7 @@ type Server struct {
DBConnectionString string `env:"SOFTPLAYER_DB_CONNECTION_STRING"`
RedisHost string `env:"SOFTPLAYER_REDIS_HOST"`
// JWT parameters
RefrestTokenTTL time.Duration `default:"8h"`
RefreshTokenTTL time.Duration `default:"8h"`
AccessTokenTTL time.Duration `default:"15m"`
JWTSecret string `default:"qwertyu9"`
// Dev and logging
@@ -71,7 +71,7 @@ func (cmd *Server) Run(ctx context.Context) error {
authController := controllers.NewAuthController(
[]byte(cmd.JWTSecret),
cmd.AccessTokenTTL,
cmd.RefrestTokenTTL,
cmd.RefreshTokenTTL,
rdb,
)
@@ -106,7 +106,7 @@ func (cmd *Server) Run(ctx context.Context) error {
HashCost: cmd.HashCost,
DB: db,
DevMode: cmd.DevMode,
RefreshTokenTTL: cmd.RefrestTokenTTL,
RefreshTokenTTL: cmd.RefreshTokenTTL,
AccessTokenTTL: cmd.AccessTokenTTL,
JWTSecret: []byte(cmd.JWTSecret),
Redis: rdb,