check error
This commit is contained in:
@@ -215,7 +215,13 @@ func (aH *AccessHandler) Me(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
claims := token.Claims.(jwt.MapClaims)
|
claims, ok := token.Claims.(jwt.MapClaims)
|
||||||
|
if !ok {
|
||||||
|
aH.logger.Error("Me", "error: token.Claims.(jwt.MapClaims)")
|
||||||
|
c.JSON(http.StatusInternalServerError, nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"id": claims["id"],
|
"id": claims["id"],
|
||||||
"user": claims["username"],
|
"user": claims["username"],
|
||||||
|
|||||||
Reference in New Issue
Block a user