diff --git a/frontend/bun.lockb b/frontend/bun.lockb index 0b06ed5..a0f152b 100755 Binary files a/frontend/bun.lockb and b/frontend/bun.lockb differ diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index ff6e277..221bc4f 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -12,6 +12,7 @@ export default defineConfig({ changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, ""), }, - } + }, + allowedHosts: true, } }); diff --git a/internal/hooks/hooks.go b/internal/hooks/hooks.go index 6b72591..15947be 100644 --- a/internal/hooks/hooks.go +++ b/internal/hooks/hooks.go @@ -110,8 +110,8 @@ func (hooks *Hooks) UseUserContext(c *gin.Context) types.UserContext { log.Debug().Msg("Provider exists") // Check if the oauth email is whitelisted - if !hooks.Auth.EmailWhitelisted(cookie.Username) { - log.Error().Str("email", cookie.Username).Msg("Email is not whitelisted") + if !hooks.Auth.EmailWhitelisted(cookie.Email) { + log.Error().Str("email", cookie.Email).Msg("Email is not whitelisted") // It isn't so we delete the cookie and return an empty context hooks.Auth.DeleteSessionCookie(c) diff --git a/internal/providers/github.go b/internal/providers/github.go index 46657d5..a67b4e8 100644 --- a/internal/providers/github.go +++ b/internal/providers/github.go @@ -103,6 +103,7 @@ func GetGithubUser(client *http.Client) (constants.Claims, error) { for _, email := range emails { if email.Primary { // Set the email then exit + log.Debug().Str("email", email.Email).Msg("Found primary email") user.Email = email.Email break } @@ -115,6 +116,7 @@ func GetGithubUser(client *http.Client) (constants.Claims, error) { // Set the email if it is not set picking the first one if user.Email == "" { + log.Warn().Str("email", emails[0].Email).Msg("No primary email found, using first email") user.Email = emails[0].Email }