-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ju-Wiluis William Rodriguez Hernandez
committed
Jun 23, 2024
1 parent
27067de
commit 3de4446
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package handlers | ||
|
||
import ( | ||
"encoding/json" | ||
"net/http" | ||
|
||
"github.com/Luis97lol/auth-service/database" | ||
"github.com/gorilla/mux" | ||
) | ||
|
||
func DeleteHandler(w http.ResponseWriter, r *http.Request) { | ||
// Read token from Authorization header | ||
LogoutHandler(w, r) | ||
vars := mux.Vars(r) | ||
oid := vars["oid"] | ||
userId := vars["userId"] | ||
database.DeleteUser(oid, userId) | ||
|
||
// Respond with username | ||
response := map[string]string{"response": "Session closed successfully"} | ||
json.NewEncoder(w).Encode(response) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters