DeleteToken deletes a token using did and uuid
(did string, tokenUUID string)
| 315 | |
| 316 | // DeleteToken deletes a token using did and uuid |
| 317 | func DeleteToken(did string, tokenUUID string) error { |
| 318 | result := db.Where("user_did = ? AND token_uuid = ?", did, tokenUUID).Delete(&Token{}) |
| 319 | if result.Error != nil { |
| 320 | return result.Error |
| 321 | } |
| 322 | if result.RowsAffected == 0 { |
| 323 | return fmt.Errorf("token not found") |
| 324 | } |
| 325 | return nil |
| 326 | } |
| 327 | |
| 328 | // DeleteTokenViaBasic deletes a token using the username and password |
| 329 | func DeleteTokenViaBasic(username string, password string) error { |