From 74aae18fee0a55d511450849623625f12cb196d6 Mon Sep 17 00:00:00 2001 From: Bagas Aulia Rezki Date: Mon, 13 May 2024 16:56:19 +0700 Subject: [PATCH] Remove Google OAuth2 token revocation logic; tokens expire naturally over time, eliminating the need for manual revocation --- handler/auth/google/callback/callback.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/handler/auth/google/callback/callback.go b/handler/auth/google/callback/callback.go index b89e0fd..ea2a412 100644 --- a/handler/auth/google/callback/callback.go +++ b/handler/auth/google/callback/callback.go @@ -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)