diff --git a/packages/dev-utils/src/devApp/apiFactories.ts b/packages/dev-utils/src/devApp/apiFactories.ts index 967918d87a..7ac6aff261 100644 --- a/packages/dev-utils/src/devApp/apiFactories.ts +++ b/packages/dev-utils/src/devApp/apiFactories.ts @@ -24,6 +24,10 @@ import { AlertApiForwarder, oauthRequestApiRef, OAuthRequestManager, + GoogleAuth, + googleAuthApiRef, + GithubAuth, + githubAuthApiRef, } from '@backstage/core'; // TODO(rugvip): We should likely figure out how to reuse all of these between apps @@ -49,3 +53,25 @@ export const oauthRequestApiFactory = createApiFactory({ deps: {}, factory: () => new OAuthRequestManager(), }); + +export const googleAuthApiFactory = createApiFactory({ + implements: googleAuthApiRef, + deps: { oauthRequestApi: oauthRequestApiRef }, + factory: ({ oauthRequestApi }) => + GoogleAuth.create({ + apiOrigin: 'http://localhost:7000', + basePath: '/auth/', + oauthRequestApi, + }), +}); + +export const githubAuthApiFactory = createApiFactory({ + implements: githubAuthApiRef, + deps: { oauthRequestApi: oauthRequestApiRef }, + factory: ({ oauthRequestApi }) => + GithubAuth.create({ + apiOrigin: 'http://localhost:7000', + basePath: '/auth/', + oauthRequestApi, + }), +});