mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-11-01 22:55:44 +00:00
refactor: only accept claims following the OIDC spec
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
"tinyauth/internal/constants"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
@@ -13,9 +14,9 @@ func GoogleScopes() []string {
|
||||
return []string{"https://www.googleapis.com/auth/userinfo.email"}
|
||||
}
|
||||
|
||||
func GetGoogleUser(client *http.Client) (map[string]interface{}, error) {
|
||||
func GetGoogleUser(client *http.Client) (constants.Claims, error) {
|
||||
// Create user struct
|
||||
user := make(map[string]interface{})
|
||||
var user constants.Claims
|
||||
|
||||
// Get the user info from google using the oauth http client
|
||||
res, err := client.Get("https://www.googleapis.com/userinfo/v2/me")
|
||||
|
||||
Reference in New Issue
Block a user