This commit is contained in:
2022-12-09 23:26:38 -06:00
parent 8df6231b71
commit d8a6c8acd1
15 changed files with 643 additions and 56 deletions

View File

@@ -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()
}