Skip to content

Commit

Permalink
Fixes issue related to oauth users with domain attribute not saving
Browse files Browse the repository at this point in the history
  • Loading branch information
pushchris committed Oct 15, 2023
1 parent 93f05a5 commit 4753bc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/platform/src/auth/AuthProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ export default abstract class AuthProvider {
return await createOrganization(domain)
}

async login(params: AuthAdminParams, ctx: AuthContext, redirect?: string): Promise<OAuthResponse> {
async login({ domain, ...params }: AuthAdminParams, ctx: AuthContext, redirect?: string): Promise<OAuthResponse> {

// Check for existing, otherwise create one
let admin = await getAdminByEmail(params.email)
if (!admin) {
const organization = await this.loadAuthOrganization(ctx, params.domain)
const organization = await this.loadAuthOrganization(ctx, domain)
admin = await Admin.insertAndFetch({
...params,
organization_id: organization.id,
Expand Down

0 comments on commit 4753bc7

Please sign in to comment.