message: auth-backend: migrate auth0 provider to use integration helper
diff: @@ -38,11 +38,11 @@ import {
  } from '../../lib/passport';
  import {
  RedirectInfo,
  - AuthProviderFactory,
  AuthHandler,
  SignInResolver,
  AuthResolverContext,
  } from '../types';
  +import { createAuthProviderIntegration } from '../createAuthProviderIntegration';
  type PrivateInfo = {
  refreshToken: string;
  @@ -188,8 +188,13 @@ export type Auth0ProviderOptions = {
  };
  };
  -/** @public */
  -export const createAuth0Provider = (options?: {
  +/**
  + * Auth provider integration for auth0 auth
  + *
  + * @public
  + */
  +export const auth0 = createAuthProviderIntegration({
  + create(options?: {
  /**
  * The profile transformation function used to verify and convert the auth response
  * into the profile that will be presented to the user.
  @@ -205,7 +210,7 @@ export const createAuth0Provider = (options?: {
  */
  resolver: SignInResolver<OAuthResult>;
  };
  -}): AuthProviderFactory => {
  + }) {
  return ({ providerId, globalConfig, config, resolverContext }) =>
  OAuthEnvironmentHandler.mapConfig(config, envConfig => {
  const clientId = envConfig.getString('clientId');
  @@ -240,4 +245,10 @@ export const createAuth0Provider = (options?: {
  callbackUrl,
  });
  });
  -};
  + },
  +});
  +
  +/**
  + * @deprecated Use `providers.auth0.create` instead.
  + */
  +export const createAuth0Provider = auth0.create;
  