Merge pull request #24 from fossyy/staging
Remove Google OAuth2 token revocation logic
This commit is contained in:
@ -132,26 +132,6 @@ func GET(w http.ResponseWriter, r *http.Request) {
|
||||
userInfoResp, err := client.Do(req)
|
||||
defer userInfoResp.Body.Close()
|
||||
|
||||
jsonData := map[string]string{
|
||||
"token": oauthData.AccessToken,
|
||||
}
|
||||
|
||||
requestBody, err := json.Marshal(jsonData)
|
||||
|
||||
response, err := http.Post("https://oauth2.googleapis.com/revoke", "application/json", bytes.NewBuffer(requestBody))
|
||||
if err != nil {
|
||||
log.Error("Error revoking access token: ", err)
|
||||
http.Error(w, "Failed to revoke access token", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
defer response.Body.Close()
|
||||
|
||||
if response.StatusCode != http.StatusOK {
|
||||
log.Error("Error revoking access token: ", response.StatusCode)
|
||||
http.Error(w, "Failed to revoke access token", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
var oauthUser OauthUser
|
||||
if err := json.NewDecoder(userInfoResp.Body).Decode(&oauthUser); err != nil {
|
||||
log.Error("Error reading user info response body:", err)
|
||||
|
Reference in New Issue
Block a user