From f39da1f76b7facf66851c9809fc1becb6d2de0ac Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Wed, 31 Oct 2018 17:57:21 -0600 Subject: [PATCH] review: fixed function name --- .../server/app/middleware/passport/strategies/facebook.ts | 4 ++-- src/core/server/app/middleware/passport/strategies/google.ts | 4 ++-- src/core/server/app/url.ts | 4 ++-- .../server/graph/tenant/resolvers/oidc_auth_integration.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/server/app/middleware/passport/strategies/facebook.ts b/src/core/server/app/middleware/passport/strategies/facebook.ts index c0f202737..54859d0b6 100644 --- a/src/core/server/app/middleware/passport/strategies/facebook.ts +++ b/src/core/server/app/middleware/passport/strategies/facebook.ts @@ -3,7 +3,7 @@ import { Profile, Strategy } from "passport-facebook"; import { Config } from "talk-common/config"; import OAuth2Strategy from "talk-server/app/middleware/passport/strategies/oauth2"; -import { reconstructTenantURL } from "talk-server/app/url"; +import { constructTenantURL } from "talk-server/app/url"; import { GQLAuthIntegrations, GQLFacebookAuthIntegration, @@ -90,7 +90,7 @@ export default class FacebookStrategy extends OAuth2Strategy< { clientID: integration.clientID, clientSecret: integration.clientSecret, - callbackURL: reconstructTenantURL( + callbackURL: constructTenantURL( this.config, tenant, "/api/tenant/auth/facebook/callback" diff --git a/src/core/server/app/middleware/passport/strategies/google.ts b/src/core/server/app/middleware/passport/strategies/google.ts index 9e793e722..88fb4d7f7 100644 --- a/src/core/server/app/middleware/passport/strategies/google.ts +++ b/src/core/server/app/middleware/passport/strategies/google.ts @@ -3,7 +3,7 @@ import { Profile, Strategy } from "passport-google-oauth2"; import { Config } from "talk-common/config"; import OAuth2Strategy from "talk-server/app/middleware/passport/strategies/oauth2"; -import { reconstructTenantURL } from "talk-server/app/url"; +import { constructTenantURL } from "talk-server/app/url"; import { GQLAuthIntegrations, GQLGoogleAuthIntegration, @@ -103,7 +103,7 @@ export default class GoogleStrategy extends OAuth2Strategy< { clientID: integration.clientID, clientSecret: integration.clientSecret, - callbackURL: reconstructTenantURL( + callbackURL: constructTenantURL( this.config, tenant, "/api/tenant/auth/google/callback" diff --git a/src/core/server/app/url.ts b/src/core/server/app/url.ts index d9b7da56d..de4686e24 100644 --- a/src/core/server/app/url.ts +++ b/src/core/server/app/url.ts @@ -14,9 +14,9 @@ export function reconstructURL(req: Request, path: string = "/"): string { } /** - * reconstructTenantURL will reconstruct a URL based off of the Tenant's domain. + * constructTenantURL will construct a URL based off of the Tenant's domain. */ -export function reconstructTenantURL( +export function constructTenantURL( config: Config, tenant: Pick, path: string = "/" diff --git a/src/core/server/graph/tenant/resolvers/oidc_auth_integration.ts b/src/core/server/graph/tenant/resolvers/oidc_auth_integration.ts index 44e28b6ec..3bd4aab70 100644 --- a/src/core/server/graph/tenant/resolvers/oidc_auth_integration.ts +++ b/src/core/server/graph/tenant/resolvers/oidc_auth_integration.ts @@ -1,4 +1,4 @@ -import { reconstructTenantURL, reconstructURL } from "talk-server/app/url"; +import { constructTenantURL, reconstructURL } from "talk-server/app/url"; import { GQLOIDCAuthIntegration, GQLOIDCAuthIntegrationTypeResolver, @@ -19,7 +19,7 @@ const OIDCAuthIntegration: GQLOIDCAuthIntegrationTypeResolver< // Note that when constructing the callback url with the tenant, the port // information is lost. - return reconstructTenantURL(ctx.config, ctx.tenant, path); + return constructTenantURL(ctx.config, ctx.tenant, path); }, };