Feat(auth): Remove auth provider entity (#6314)
**What** - remove auth provider entity **Why** - The auth provider entity was not really used anywhere **How** - Keeping loader behavior as is but removing the Co-authored-by: Sebastian Rindom <7554214+srindom@users.noreply.github.com>
This commit is contained in:
co-authored by
Sebastian Rindom
parent
b2eaac8cb1
commit
882aa549bd
@@ -1,41 +0,0 @@
|
||||
import { SqlEntityManager } from "@mikro-orm/postgresql"
|
||||
import { AuthProvider } from "@models"
|
||||
|
||||
export async function createAuthProviders(
|
||||
manager: SqlEntityManager,
|
||||
providerData: any[] = [
|
||||
{
|
||||
provider: "manual",
|
||||
name: "manual",
|
||||
is_active: true,
|
||||
},
|
||||
{
|
||||
provider: "disabled",
|
||||
name: "disabled",
|
||||
},
|
||||
{
|
||||
provider: "store",
|
||||
name: "store",
|
||||
domain: "store",
|
||||
is_active: true,
|
||||
},
|
||||
{
|
||||
provider: "admin",
|
||||
name: "admin",
|
||||
domain: "admin",
|
||||
is_active: true,
|
||||
},
|
||||
]
|
||||
): Promise<AuthProvider[]> {
|
||||
const authProviders: AuthProvider[] = []
|
||||
|
||||
for (const provider of providerData) {
|
||||
const authProvider = manager.create(AuthProvider, provider)
|
||||
|
||||
authProviders.push(authProvider)
|
||||
}
|
||||
|
||||
await manager.persistAndFlush(authProviders)
|
||||
|
||||
return authProviders
|
||||
}
|
||||
Reference in New Issue
Block a user