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

@@ -2,6 +2,7 @@ package providers
import (
"fmt"
"tinyauth/internal/constants"
"tinyauth/internal/oauth"
"tinyauth/internal/types"
@@ -93,9 +94,9 @@ func (providers *Providers) GetProvider(provider string) *oauth.OAuth {
}
}
func (providers *Providers) GetUser(provider string) (map[string]interface{}, error) {
func (providers *Providers) GetUser(provider string) (constants.Claims, error) {
// Create user struct
user := make(map[string]interface{})
var user constants.Claims
// Get the user from the provider
switch provider {