PLT-975 adding perm deletes

This commit is contained in:
=Corey Hulen
2015-11-15 18:18:02 -08:00
parent 48d2f86b90
commit 03c6dcbd86
18 changed files with 419 additions and 0 deletions

View File

@@ -332,3 +332,21 @@ func (as SqlOAuthStore) RemoveAuthData(code string) StoreChannel {
return storeChannel
}
func (as SqlOAuthStore) RemoveAuthDataByUserId(userId string) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
result := StoreResult{}
_, err := as.GetMaster().Exec("DELETE FROM OAuthAuthData WHERE UserId = :UserId", map[string]interface{}{"UserId": userId})
if err != nil {
result.Err = model.NewAppError("SqlOAuthStore.RemoveAuthDataByUserId", "We couldn't remove the authorization code", "err="+err.Error())
}
storeChannel <- result
close(storeChannel)
}()
return storeChannel
}