From 85545aba62546f219a9c9730945511412a3174ef Mon Sep 17 00:00:00 2001 From: jloup Date: Fri, 4 May 2018 11:55:15 +0200 Subject: Password reset. --- api/api.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'api/api.go') diff --git a/api/api.go b/api/api.go index 7b7be49..42b9923 100644 --- a/api/api.go +++ b/api/api.go @@ -7,6 +7,22 @@ import ( "github.com/gin-gonic/gin" ) +var CONFIG Config + +type Config struct { + JwtSecret string `toml:"jwt_secret"` + PasswordResetSecret string `toml:"password_reset_secret"` + FreeSMSUser string `toml:"free_sms_user"` + FreeSMSPass string `toml:"free_sms_pass"` +} + +func SetConfig(config Config) { + CONFIG = config + + JWT_SECRET = []byte(config.JwtSecret) + PASSWORD_RESET_SECRET = []byte(config.PasswordResetSecret) +} + type Error struct { Code ErrorCode UserMessage string -- cgit v1.2.3