1
0

Vikunja now uses viper to handle config

This commit is contained in:
konrad
2018-09-08 13:29:35 +02:00
parent 4f3e016751
commit 427f752990
13 changed files with 256 additions and 109 deletions

View File

@ -6,6 +6,7 @@ import (
"encoding/hex"
"github.com/dgrijalva/jwt-go"
"github.com/labstack/echo"
"github.com/spf13/viper"
"net/http"
"time"
)
@ -57,7 +58,7 @@ func Login(c echo.Context) error {
claims["avatar"] = hex.EncodeToString(avatar[:])
// Generate encoded token and send it as response.
t, err := token.SignedString(models.Config.JWTLoginSecret)
t, err := token.SignedString([]byte(viper.GetString("service.JWTSecret")))
if err != nil {
return err
}