mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 17:30:46 +00:00
Initial Move from Azure DevOps to GitHub
This commit is contained in:
20
src/TokenProviders/TokenProviderFactory.ts
Normal file
20
src/TokenProviders/TokenProviderFactory.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import * as ViewModels from "../Contracts/ViewModels";
|
||||
import { PlatformType } from "../PlatformType";
|
||||
import { PortalTokenProvider } from "./PortalTokenProvider";
|
||||
|
||||
export class TokenProviderFactory {
|
||||
private constructor() {}
|
||||
|
||||
public static create(): ViewModels.TokenProvider {
|
||||
const platformType = window.dataExplorerPlatform;
|
||||
switch (platformType) {
|
||||
case PlatformType.Portal:
|
||||
case PlatformType.Hosted:
|
||||
return new PortalTokenProvider();
|
||||
case PlatformType.Emulator:
|
||||
default:
|
||||
// should never get into this state
|
||||
throw new Error(`Unknown platform ${platformType}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user