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 9, 2024
1 parent 3bb78b1 commit d4f01c3
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 @@ -297,6 +297,9 @@ export class AuthAdminState extends Model({
async refreshConfig() {
const conn = connCtx.get(this)!;

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

const {result} = await conn.query(
`with module ext::auth
select {
Expand All @@ -310,10 +313,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 d4f01c3

Please sign in to comment.