aboutsummaryrefslogtreecommitdiff
path: root/api/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/api.go')
-rw-r--r--api/api.go16
1 files changed, 16 insertions, 0 deletions
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 (
7 "github.com/gin-gonic/gin" 7 "github.com/gin-gonic/gin"
8) 8)
9 9
10var CONFIG Config
11
12type Config struct {
13 JwtSecret string `toml:"jwt_secret"`
14 PasswordResetSecret string `toml:"password_reset_secret"`
15 FreeSMSUser string `toml:"free_sms_user"`
16 FreeSMSPass string `toml:"free_sms_pass"`
17}
18
19func SetConfig(config Config) {
20 CONFIG = config
21
22 JWT_SECRET = []byte(config.JwtSecret)
23 PASSWORD_RESET_SECRET = []byte(config.PasswordResetSecret)
24}
25
10type Error struct { 26type Error struct {
11 Code ErrorCode 27 Code ErrorCode
12 UserMessage string 28 UserMessage string