@@ -26,7 +26,7 @@ const secretkey = "verysecretkey1995"
26
26
27
27
func Init (logging bool ) * gin.Engine {
28
28
29
- conf := config .GetConfig ()
29
+ conf := config .Load ()
30
30
31
31
var router * gin.Engine
32
32
@@ -71,6 +71,8 @@ func Init(logging bool) *gin.Engine {
71
71
private .GET ("/user/cancel" , user .CancelSubscription )
72
72
public .GET ("/user/logout" , user .Logout ) //public so this router can skip auth middleware
73
73
74
+ public .GET ("/user/confirm_email/:token" , user .ConfirmEmail )
75
+
74
76
protected .GET ("/plans/:id" , plan .Plan )
75
77
protected .POST ("/plans/create" , plan .CreatePlan )
76
78
protected .PUT ("/plans/update/:id" , plan .UpdatePlan )
@@ -100,7 +102,7 @@ func Init(logging bool) *gin.Engine {
100
102
101
103
func auth (secret string , protected bool ) gin.HandlerFunc {
102
104
return func (c * gin.Context ) {
103
- conf := config .GetConfig ()
105
+ conf := config .Load ()
104
106
if conf .App .EnableAuth {
105
107
var usersession models.UserAppSession
106
108
@@ -149,7 +151,7 @@ func auth(secret string, protected bool) gin.HandlerFunc {
149
151
if err != nil {
150
152
logger .Log (logger.Fields {
151
153
Loc : "router.go - auth()" ,
152
- Code : errors .TokenInvalid .Code ,
154
+ Code : errors .RefresCookieMissing .Code ,
153
155
Err : err .Error (),
154
156
})
155
157
clearCookies (c )
@@ -271,7 +273,7 @@ func auth(secret string, protected bool) gin.HandlerFunc {
271
273
}
272
274
273
275
func clearCookies (c * gin.Context ) {
274
- conf := config .GetConfig ()
276
+ conf := config .Load ()
275
277
c .SetCookie (conf .App .AuthCookieName , "" , - 1 , "/" , conf .App .Domain , false , true )
276
278
c .SetCookie (conf .App .RefreshCookieName , "" , - 1 , "/" , conf .App .Domain , false , true )
277
279
c .SetCookie ("uid" , "" , - 1 , "/" , conf .App .Domain , false , false )
0 commit comments