refactor: only accept claims following the OIDC spec

This commit is contained in:
Stavros
2025-04-25 15:28:24 +03:00
parent 13032e564d
commit 5e4e2ddbd9
7 changed files with 32 additions and 19 deletions

View File

@@ -4,13 +4,14 @@ import (
"encoding/json"
"io"
"net/http"
"tinyauth/internal/constants"
"github.com/rs/zerolog/log"
)
func GetGenericUser(client *http.Client, url string) (map[string]interface{}, error) {
func GetGenericUser(client *http.Client, url string) (constants.Claims, error) {
// Create user struct
user := make(map[string]interface{})
var user constants.Claims
// Using the oauth client get the user info url
res, err := client.Get(url)