mirror of
https://github.com/wassname/talk.git
synced 2026-07-09 21:36:00 +08:00
review: fixed function name
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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<Tenant, "domain">,
|
||||
path: string = "/"
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user