Skip to content

Commit

Permalink
Only query webauthn provider data if it exists in schema
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclarke committed Feb 14, 2024
1 parent 13615fa commit 924f0a5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions shared/studio/tabs/auth/state/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ export class AuthAdminState extends Model({
brand_color,
`;

const hasWebAuthn =
!!this.providersInfo["ext::auth::WebAuthnProviderConfig"];

const {result} = await conn.query(
`with module ext::auth
select {
Expand All @@ -279,10 +282,17 @@ export class AuthAdminState extends Model({
[is OAuthProviderConfig].client_id,
[is OAuthProviderConfig].additional_scope,
require_verification := (
[is EmailPasswordProviderConfig].require_verification ??
[is WebAuthnProviderConfig].require_verification
[is EmailPasswordProviderConfig].require_verification${
hasWebAuthn
? ` ?? [is WebAuthnProviderConfig].require_verification`
: ""
}
),
[is WebAuthnProviderConfig].relying_party_origin
${
hasWebAuthn
? `[is WebAuthnProviderConfig].relying_party_origin`
: ""
}
},
ui: {
redirect_to,
Expand Down

0 comments on commit 924f0a5

Please sign in to comment.