more
This commit is contained in:
@@ -13,7 +13,6 @@ type LoginBody struct {
|
||||
}
|
||||
|
||||
func login(c *gin.Context) {
|
||||
|
||||
var loginBody LoginBody
|
||||
if err := c.BindJSON(&loginBody); err != nil {
|
||||
fmt.Println(err)
|
||||
@@ -31,7 +30,6 @@ func login(c *gin.Context) {
|
||||
"error": "invalid username or password",
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func updateLogin(c *gin.Context) {
|
||||
@@ -43,3 +41,12 @@ func updateLogin(c *gin.Context) {
|
||||
storage.UpdateUsername(updateLogin.Username)
|
||||
storage.UpdatePassword(updateLogin.Password)
|
||||
}
|
||||
|
||||
func getLoginTokens(c *gin.Context) {
|
||||
tokens := storage.GetLoginTokensSimple()
|
||||
c.JSON(200, tokens)
|
||||
}
|
||||
|
||||
func clearLoginTokens(c *gin.Context) {
|
||||
storage.ClearLoginTokens()
|
||||
}
|
||||
Reference in New Issue
Block a user