@proveanything/smartlinks-auth-ui 0.3.12 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/SmartlinksAuthUI.d.ts.map +1 -1
- package/dist/index.esm.js +8 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -12341,7 +12341,7 @@ const getExpirationFromResponse = (response) => {
|
|
|
12341
12341
|
// Default Smartlinks Google OAuth Client ID (public - safe to expose)
|
|
12342
12342
|
const DEFAULT_GOOGLE_CLIENT_ID = '696509063554-jdlbjl8vsjt7cr0vgkjkjf3ffnvi3a70.apps.googleusercontent.com';
|
|
12343
12343
|
// Default Google OAuth proxy URL (hosted on our whitelisted domain)
|
|
12344
|
-
const DEFAULT_GOOGLE_PROXY_URL = 'https://smartlinks
|
|
12344
|
+
const DEFAULT_GOOGLE_PROXY_URL = 'https://smartlinks.app/apps/account/stable/google-proxy.html';
|
|
12345
12345
|
// Exact hostnames where Google OAuth is registered and inline/OneTap flow works directly.
|
|
12346
12346
|
// Only specific registered origins — NOT broad wildcards like *.lovable.app
|
|
12347
12347
|
const WHITELISTED_GOOGLE_OAUTH_HOSTS = [
|
|
@@ -12353,11 +12353,15 @@ const WHITELISTED_GOOGLE_OAUTH_HOSTS = [
|
|
|
12353
12353
|
/**
|
|
12354
12354
|
* Check if the current domain is whitelisted for direct Google OAuth.
|
|
12355
12355
|
* Uses exact hostname match (plus subdomain match for smartlinks.app production).
|
|
12356
|
+
* Merges the hardcoded list with any additional domains from auth kit config.
|
|
12356
12357
|
* Returns true if OneTap/inline flow can work without a proxy.
|
|
12357
12358
|
*/
|
|
12358
|
-
const isWhitelistedGoogleDomain = () => {
|
|
12359
|
+
const isWhitelistedGoogleDomain = (additionalDomains) => {
|
|
12359
12360
|
const hostname = window.location.hostname;
|
|
12360
|
-
|
|
12361
|
+
const allDomains = additionalDomains?.length
|
|
12362
|
+
? [...WHITELISTED_GOOGLE_OAUTH_HOSTS, ...additionalDomains]
|
|
12363
|
+
: WHITELISTED_GOOGLE_OAUTH_HOSTS;
|
|
12364
|
+
return allDomains.some(domain => hostname === domain || hostname.endsWith(`.${domain}`));
|
|
12361
12365
|
};
|
|
12362
12366
|
// Default auth UI configuration when no clientId is provided
|
|
12363
12367
|
const DEFAULT_AUTH_CONFIG = {
|
|
@@ -13138,7 +13142,7 @@ const SmartlinksAuthUI = ({ apiEndpoint, clientId, clientName, accountData, onAu
|
|
|
13138
13142
|
// - If user has their own Google Client ID, they've registered their domains — no proxy needed
|
|
13139
13143
|
// - If on a whitelisted SmartLinks domain, inline flow works directly
|
|
13140
13144
|
// - Otherwise, auto-use the default proxy URL
|
|
13141
|
-
const isWhitelisted = isWhitelistedGoogleDomain();
|
|
13145
|
+
const isWhitelisted = isWhitelistedGoogleDomain(config?.whitelistedGoogleDomains);
|
|
13142
13146
|
const googleProxyUrl = config?.googleOAuthProxyUrl
|
|
13143
13147
|
|| (!hasCustomGoogleClientId && !isWhitelisted ? DEFAULT_GOOGLE_PROXY_URL : undefined);
|
|
13144
13148
|
log.log('Google Auth initiated:', {
|