From 2c79b787074dd7599277265157dda928f80f8f56 Mon Sep 17 00:00:00 2001 From: Dmitry Savelev Date: Fri, 4 Oct 2024 12:45:02 +0200 Subject: [PATCH] fix email domain --- src/main/java/vercel/VercelMPIdentityProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/vercel/VercelMPIdentityProvider.java b/src/main/java/vercel/VercelMPIdentityProvider.java index b283557..0a2113f 100755 --- a/src/main/java/vercel/VercelMPIdentityProvider.java +++ b/src/main/java/vercel/VercelMPIdentityProvider.java @@ -40,6 +40,7 @@ public class VercelMPIdentityProvider extends OIDCIdentityProvider implements SocialIdentityProvider { private static final String BROKER_NONCE_PARAM = "BROKER_NONCE"; + private static final String EMAIL_FALLBACK_TEMPLATE = "%s@vercelmp.internal"; private static final Logger logger = Logger.getLogger(VercelMPIdentityProvider.class); //private static final String AUTH_URL = "https://api.vercel.com/oauth/authorize"; @@ -152,7 +153,7 @@ protected BrokeredIdentityContext extractIdentity(AccessTokenResponse tokenRespo String userIdPerInstallation = (String) idToken.getOtherClaims().get("user_id") if (email == null || email.isEmpty()) { - email = userIdPerInstallation + "@vercel-marketplace.com"; + email = EMAIL_FALLBACK_TEMPLATE.formatted(userIdPerInstallation); } // Global user ID is provided by Vercel only for Neon integrations! // For other marketplace integrations it provides only user ID per each integration installation.