Skip to content

navigator.credentials.get({ password: true, mediation: 'optional' }) throws error: not assignable to parameter of type 'CredentialRequestOptions'. #34550

@naveedahmed1

Description

@naveedahmed1

TypeScript Version: 3.6.4

Search Terms:
navigator.credentials.get
navigator.credentials
credentials
navigator

Code

navigator.credentials.get({
        password: true,
        mediation: 'optional'
      }).then(c => {
      });

The above code throws below error:

Severity	Code	Description	Project	File	Line	Suppression State
Error	TS2345	(TS) Argument of type '{ password: boolean; mediation: "optional"; }' is not assignable to parameter of type 'CredentialRequestOptions'.
  Object literal may only specify known properties, and 'password' does not exist in type 'CredentialRequestOptions'.	D:\MyProject\ClientApp (tsconfig or jsconfig project)	D:\MyProject\ClientApp\src\app\shared\services\global.service.ts	230	Active

Expected behavior:
It should compile successfully.

Actual behavior:

It throws below error:

Severity	Code	Description	Project	File	Line	Suppression State
Error	TS2345	(TS) Argument of type '{ password: boolean; mediation: "optional"; }' is not assignable to parameter of type 'CredentialRequestOptions'.
  Object literal may only specify known properties, and 'password' does not exist in type 'CredentialRequestOptions'.	D:\MyProject\ClientApp (tsconfig or jsconfig project)	D:\MyProject\ClientApp\src\app\shared\services\global.service.ts	230	Active

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalRelates to another program, environment, or user action which we cannot control.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions