-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
129 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { OidcOrganizationLoginProviderNameEnum } from './client/src'; | ||
|
||
type ProviderFn = (org: string) => string; | ||
|
||
export type OrgProviders = { | ||
oidc: OrgaizationsIdentityProviders; | ||
}; | ||
|
||
export type OrgaizationsIdentityProviders = { | ||
[provider in OidcOrganizationLoginProviderNameEnum]: ProviderFn; | ||
}; | ||
|
||
/** | ||
* Usecase for this would be an 'invite' flow, where you want to have a user | ||
* sign up and be added to inviter org | ||
* @param workspace | ||
* @returns a dictionary of urls to navigate to for redirection | ||
*/ | ||
export const organizationProviders = (basePath?: string, workspace?: string) => | ||
Object.values(OidcOrganizationLoginProviderNameEnum).reduce( | ||
(accum: OrgaizationsIdentityProviders, providerName) => { | ||
accum[providerName] = (org: string) => | ||
[ | ||
basePath, | ||
'workspaces', | ||
workspace, | ||
'orgs', | ||
org, | ||
'oidc', | ||
'providers', | ||
providerName, | ||
'login', | ||
].join('/'); | ||
return accum; | ||
}, | ||
{} as OrgaizationsIdentityProviders | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { OidcWorkspaceLoginProviderNameEnum } from './client/src'; | ||
|
||
type ProviderFn = () => string; | ||
|
||
export type SpaceProviders = { | ||
oidc: WorkspaceIdentityProviders; | ||
}; | ||
|
||
export type WorkspaceIdentityProviders = { | ||
[provider in OidcWorkspaceLoginProviderNameEnum]: ProviderFn; | ||
}; | ||
|
||
/** | ||
* Usecase for this would be an 'login' flow, a user signs up to the Nile app | ||
* @param workspace | ||
* @returns a dictionary of urls to navigate to for redirection | ||
*/ | ||
export const workspaceProviders = (basePath?: string, workspace?: string) => | ||
Object.values(OidcWorkspaceLoginProviderNameEnum).reduce( | ||
(accum: WorkspaceIdentityProviders, providerName) => { | ||
accum[providerName] = () => | ||
[ | ||
basePath, | ||
'workspaces', | ||
workspace, | ||
'oidc', | ||
'providers', | ||
providerName, | ||
'login', | ||
].join('/'); | ||
return accum; | ||
}, | ||
{} as WorkspaceIdentityProviders | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97b88a3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nile-js – ./
nile-js-theniledev.vercel.app
nile-js-git-master-theniledev.vercel.app
nile-js.vercel.app
97b88a3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
react-storybook – ./
react-storybook-theniledev.vercel.app
react-storybook-ten.vercel.app
react-storybook-git-master-theniledev.vercel.app
storybook.thenile.dev