Better config handling with constants (#83)
This commit is contained in:
parent
f1d21ea52b
commit
1f1a079fd3
17 changed files with 200 additions and 120 deletions
|
|
@ -17,11 +17,11 @@
|
|||
package v1
|
||||
|
||||
import (
|
||||
"code.vikunja.io/api/pkg/config"
|
||||
"code.vikunja.io/api/pkg/models"
|
||||
"code.vikunja.io/web/handler"
|
||||
"github.com/dgrijalva/jwt-go"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/spf13/viper"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
|
@ -77,5 +77,5 @@ func CreateNewJWTTokenForUser(user *models.User) (token string, err error) {
|
|||
claims["avatar"] = user.AvatarURL
|
||||
|
||||
// Generate encoded token and send it as response.
|
||||
return t.SignedString([]byte(viper.GetString("service.JWTSecret")))
|
||||
return t.SignedString([]byte(config.ServiceJWTSecret.GetString()))
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue