added logout
This commit is contained in:
+2
-1
@@ -38,7 +38,7 @@ func main() {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
|
||||
client, err := mongo.Connect(options.Client().ApplyURI(cfg.MongoURI))
|
||||
client, err := mongo.Connect(options.Client().ApplyURI(cfg.MongoURI).SetTimeout(10 * time.Second))
|
||||
if err != nil {
|
||||
log.Fatalf("failed to create mongodb client: %v", err)
|
||||
}
|
||||
@@ -77,6 +77,7 @@ func main() {
|
||||
api.POST("/register", handler.Register)
|
||||
api.POST("/login", handler.Login)
|
||||
api.POST("/refresh", handler.Refresh)
|
||||
api.POST("/logout", handler.Logout)
|
||||
api.GET("/me", auth.AuthMiddleware([]byte(cfg.JWTSecret)), handler.Me)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user