support clear token in database after logout, support clear browser token when api responses token invalid

This commit is contained in:
MaysWind
2020-10-22 00:04:30 +08:00
parent 22234f27d8
commit 18052a22f2
7 changed files with 106 additions and 5 deletions
+3
View File
@@ -118,6 +118,9 @@ func startWebServer(c *cli.Context) error {
apiV1Route := apiRoute.Group("/v1")
apiV1Route.Use(bindMiddleware(middlewares.JWTAuthorization))
{
// Logout
apiV1Route.GET("/logout.json", bindApi(api.Tokens.TokenRevokeCurrentHandler))
// Tokens
apiV1Route.GET("/tokens/list.json", bindApi(api.Tokens.TokenListHandler))
apiV1Route.POST("/tokens/revoke.json", bindApi(api.Tokens.TokenRevokeHandler))