Last active
February 16, 2021 19:50
-
-
Save jsinglet/76a2813f55119a088fc12409db3532a8 to your computer and use it in GitHub Desktop.
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
import { TenantService, Tenant } from "../tenant/tenant.service"; | |
import { Client1loginService } from './client1login.service'; | |
import { Client2loginService } from './client2login.service'; | |
export function getLoginService( | |
tenantService: TenantService, | |
client1LoginService: Client1loginService, | |
Client2loginService: Client2loginService | |
): LoginService { | |
if (tenantService.getTenant() === Tenant.CLIENT1) { | |
return client1LoginService; | |
} else if (tenantService.getTenant() === Tenant.CLIENT2) { | |
return Client2loginService; | |
} | |
throw new Error("Unknown tenant for login service"); | |
} | |
export abstract class LoginService { | |
constructor() { } | |
abstract login(username: string, password: string): boolean; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment