Skip to content

Commit

Permalink
Merge branch 'main' into frederik/identity-meta
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederik Rothenberger committed Jul 28, 2023
2 parents c01c7b3 + 9c90e98 commit 2444291
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 32 deletions.
18 changes: 12 additions & 6 deletions src/frontend/src/components/authenticateBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,18 @@ const page = (slot: TemplateResult) => {
};

// Register this device as a new device with the anchor
const asNewDevice = async (connection: Connection, userNumber?: bigint) => {
// Prompt the user for an anchor (only used if we don't know the anchor already)
const askUserNumber = async () => {
const asNewDevice = async (
connection: Connection,
prefilledUserNumber?: bigint
) => {
// Prompt the user for an anchor and provide additional information about the flow.
// If the user number is already known, it is prefilled in the screen.
const promptUserNumberWithInfo = async (prefilledUserNumber?: bigint) => {
const result = await promptUserNumber({
title: "Add a Trusted Device",
message: "What’s your Internet Identity?",
title: "Continue with another device",
message:
"Is this your first time connecting to Internet Identity on this device? In the next steps, you will add this device as an Internet Identity passkey. Do you wish to continue?",
userNumber: prefilledUserNumber,
});
if (result === "canceled") {
// TODO L2-309: do this without reload
Expand All @@ -347,7 +353,7 @@ const asNewDevice = async (connection: Connection, userNumber?: bigint) => {
};

return registerTentativeDevice(
userNumber ?? (await askUserNumber()),
await promptUserNumberWithInfo(prefilledUserNumber),
connection
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ const deviceRegistrationDisabledInfoTemplate = ({
}) => {
const pageContentSlot = html` <article>
<hgroup>
<h1 class="t-title t-title--main">Continue with another device</h1>
<h1 class="t-title t-title--main">Add this device as a passkey</h1>
<p class="t-lead">
If this is your first time connecting to Internet Identity on this
device, follow these steps to continue:
</p>
</hgroup>
<ol class="c-list c-list--numbered l-stack">
<li>
Connect to
<strong class="t-strong">${LEGACY_II_URL_NO_PROTOCOL}</strong> on your
other device using Internet Identity
<strong class="t-strong">${userNumber}</strong>
Connect to ${LEGACY_II_URL_NO_PROTOCOL} on a recognized device using
Internet Identity ${userNumber}
</li>
<li>
Once you are connected, select “<strong class="t-string"
>Add a new passkey</strong
>
</li>
</ol>
<p class="t-paragraph t-strong">Then, press Retry below.</p>
<p class="t-paragraph">
Then, press <strong class="t-strong">Refresh</strong> below.
</p>
<div class="l-stack">
<button
id="deviceRegModeDisabledRetry"
class="c-button"
@click=${() => retry()}
>
Retry
Refresh
</button>
<button
id="deviceRegModeDisabledCancel"
Expand Down
19 changes: 0 additions & 19 deletions src/internet_identity/tests/integration/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,25 +146,6 @@ fn should_not_allow_user_range_exceeding_capacity() {
);
}

/// Test to verify that the same anchor range is allowed on upgrade.
#[test]
fn ii_upgrade_should_allow_same_user_range() -> Result<(), CallError> {
let env = env();
let canister_id = install_ii_canister(&env, II_WASM_PREVIOUS.clone());

let stats = api::stats(&env, canister_id)?;

let result = upgrade_ii_canister_with_arg(
&env,
canister_id,
II_WASM.clone(),
arg_with_anchor_range(stats.assigned_user_number_range),
);

assert!(result.is_ok());
Ok(())
}

/// Tests simple upgrade and downgrade.
#[test]
fn ii_canister_can_be_upgraded_and_rolled_back() {
Expand Down

0 comments on commit 2444291

Please sign in to comment.