Skip to content

Commit

Permalink
CR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lmuntaner committed Jan 21, 2025
1 parent c96c4ca commit 3565ee7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/frontend/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// If credentials have no origin, it's because they were created in this domain
export const iiLegacyOrigin = "https://identity.ic0.app";
6 changes: 4 additions & 2 deletions src/frontend/src/utils/credential-devices.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DeviceData, DeviceKey } from "$generated/internet_identity_types";
import { iiLegacyOrigin } from "$showcase/constants";
import { iiLegacyOrigin } from "$src/constants";
import { DerEncodedPublicKey } from "@dfinity/agent";
import { supportsWebauthRoR } from "./userAgent";

Expand Down Expand Up @@ -49,7 +49,9 @@ export const convertToValidCredentialData = (
* - If they do, it returns the origin.
* - If they don't, it returns `undefined`.
*
* @param credentials
* @param {Object} params
* @param {DeviceData[]} params.credentials - The devices to check.
* @param {string} params.userAgent - The user agent string.
* @returns {string | undefined} The origin to use when adding a new device.
* - If `undefined` then no common origin was found. Probalby use `window.origin` or `undefined` for RP ID.
* - If `string` then the origin can be used to add a new device. Remember to use the hostname only for RP ID.
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/utils/findWebAuthnRpId.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { iiLegacyOrigin } from "$showcase/constants";
import { iiLegacyOrigin } from "$src/constants";
import { CredentialData } from "./credential-devices";

export const PROD_DOMAINS = [
Expand Down
1 change: 0 additions & 1 deletion src/showcase/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { getDapps } from "$src/flows/dappsExplorer/dapps";

export const dapps = getDapps();

// If credentials have no origin, it's because they were created in this domain
export const iiLegacyOrigin = "https://identity.ic0.app";

const recoveryPhraseText =
Expand Down

0 comments on commit 3565ee7

Please sign in to comment.