MCPcopy Create free account
hub / github.com/LockGit/gochat / Logout

Function Logout

api/handler/user.go:92–108  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

90}
91
92func Logout(c *gin.Context) {
93 var formLogout FormLogout
94 if err := c.ShouldBindBodyWith(&formLogout, binding.JSON); err != nil {
95 tools.FailWithMsg(c, err.Error())
96 return
97 }
98 authToken := formLogout.AuthToken
99 logoutReq := &proto.LogoutRequest{
100 AuthToken: authToken,
101 }
102 code := rpc.RpcLogicObj.Logout(logoutReq)
103 if code == tools.CodeFail {
104 tools.FailWithMsg(c, "logout fail!")
105 return
106 }
107 tools.SuccessWithMsg(c, "logout ok!", nil)
108}

Callers

nothing calls this directly

Calls 3

FailWithMsgFunction · 0.92
SuccessWithMsgFunction · 0.92
LogoutMethod · 0.45

Tested by

no test coverage detected