fix: run linter
This commit is contained in:
@@ -43,34 +43,7 @@ func TokenIsNotExpired(access_token string) bool {
|
||||
func GetUserProfile(context *gin.Context) {
|
||||
|
||||
session := sessions.Default(context)
|
||||
/* access_token := session.Get("access_token")
|
||||
user_profile_client := http.Client{}
|
||||
|
||||
user_profile_url, err := url.Parse("https://" + os.Getenv("AUTH0_DOMAIN") + os.Getenv("AUTH0_USER_INFO_ENDPOINT"))
|
||||
|
||||
if err != nil {
|
||||
log.Println("Failed to build user profile url " + err.Error())
|
||||
context.Abort()
|
||||
return
|
||||
}
|
||||
|
||||
user_profile_request, user_profile_request_error := http.NewRequest("GET", user_profile_url.String(), nil)
|
||||
if user_profile_request_error != nil {
|
||||
log.Println("Failed to initialize validation request", user_profile_request_error.Error())
|
||||
context.AbortWithStatus(http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
user_profile_request.Header.Add("Accept", "application/json")
|
||||
user_profile_request.Header.Add("Authorization", "Bearer "+access_token.(string))
|
||||
|
||||
user_profile_response, user_profile_response_err := user_profile_client.Do(user_profile_request)
|
||||
if user_profile_response_err != nil {
|
||||
log.Println("Failed to validate user")
|
||||
context.AbortWithStatus(http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
defer user_profile_response.Body.Close()
|
||||
user_profile_bytes, _ := io.ReadAll(user_profile_response.Body) */
|
||||
var user_profile dto.UserProfileResponse
|
||||
profile_session := session.Get("profile").(map[string]interface{})
|
||||
user_profile.Sub = profile_session["sub"].(string)
|
||||
|
||||
Reference in New Issue
Block a user