Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions src/frontend/src/lib/flows/authLastUsedFlow.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ import {
lastUsedIdentitiesStore,
type LastUsedIdentity,
} from "$lib/stores/last-used-identities.store";
import {
createGoogleRequestConfig,
findConfig,
isOpenIdConfig,
requestJWT,
} from "$lib/utils/openID";
import { findConfig, requestJWT } from "$lib/utils/openID";
import { get } from "svelte/store";
import { sessionStore } from "$lib/stores/session.store";
import { isNullish } from "@dfinity/utils";
Expand Down Expand Up @@ -67,15 +62,13 @@ export class AuthLastUsedFlow {
"OpenID authentication is not available for this account.",
);
}
const requestConfig = isOpenIdConfig(config)
? {
issuer,
clientId: config.client_id,
configURL: config.fedcm_uri[0],
authURL: config.auth_uri,
authScope: config.auth_scope.join(" "),
}
: createGoogleRequestConfig(config.client_id);
const requestConfig = {
issuer,
clientId: config.client_id,
configURL: config.fedcm_uri[0],
authURL: config.auth_uri,
authScope: config.auth_scope.join(" "),
};
const jwt = await requestJWT(requestConfig, {
nonce: get(sessionStore).nonce,
mediation: "optional",
Expand All @@ -90,7 +83,7 @@ export class AuthLastUsedFlow {
await authenticationStore.set({ identity, identityNumber });
lastUsedIdentitiesStore.addLastUsedIdentity(lastUsedIdentity);
authenticationV2Funnel.addProperties({
provider: isOpenIdConfig(config) ? config.name : "Google",
provider: config.name,
});
authenticationV2Funnel.trigger(AuthenticationV2Events.ContinueAsOpenID);
} else {
Expand Down
4 changes: 0 additions & 4 deletions src/frontend/src/lib/generated/internet_identity_idl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export const idlFactory = ({ IDL }) => {
const MetadataMap = IDL.Rec();
const MetadataMapV2 = IDL.Rec();
const GoogleOpenIdConfig = IDL.Record({ 'client_id' : IDL.Text });
const ArchiveConfig = IDL.Record({
'polling_interval_ns' : IDL.Nat64,
'entries_buffer_limit' : IDL.Nat64,
Expand Down Expand Up @@ -47,7 +46,6 @@ export const idlFactory = ({ IDL }) => {
});
const InternetIdentityInit = IDL.Record({
'fetch_root_key' : IDL.Opt(IDL.Bool),
'openid_google' : IDL.Opt(IDL.Opt(GoogleOpenIdConfig)),
'is_production' : IDL.Opt(IDL.Bool),
'enable_dapps_explorer' : IDL.Opt(IDL.Bool),
'assigned_user_number_range' : IDL.Opt(IDL.Tuple(IDL.Nat64, IDL.Nat64)),
Expand Down Expand Up @@ -829,7 +827,6 @@ export const idlFactory = ({ IDL }) => {
});
};
export const init = ({ IDL }) => {
const GoogleOpenIdConfig = IDL.Record({ 'client_id' : IDL.Text });
const ArchiveConfig = IDL.Record({
'polling_interval_ns' : IDL.Nat64,
'entries_buffer_limit' : IDL.Nat64,
Expand Down Expand Up @@ -875,7 +872,6 @@ export const init = ({ IDL }) => {
});
const InternetIdentityInit = IDL.Record({
'fetch_root_key' : IDL.Opt(IDL.Bool),
'openid_google' : IDL.Opt(IDL.Opt(GoogleOpenIdConfig)),
'is_production' : IDL.Opt(IDL.Bool),
'enable_dapps_explorer' : IDL.Opt(IDL.Bool),
'assigned_user_number_range' : IDL.Opt(IDL.Tuple(IDL.Nat64, IDL.Nat64)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,6 @@ export interface GetIdAliasRequest {
'relying_party' : FrontendHostname,
'identity_number' : IdentityNumber,
}
export interface GoogleOpenIdConfig { 'client_id' : string }
export type HeaderField = [string, string];
export interface HttpRequest {
'url' : string,
Expand Down Expand Up @@ -636,18 +635,14 @@ export type IdentityPropertiesReplaceError = {
* Each field is wrapped is `opt` to indicate whether the field should
* keep the previous value or update to a new value (e.g. `null` keeps the previous value).
*
* Some fields, like `openid_google`, have an additional nested `opt`, this indicates
* Some fields, like `analytics_config`, have an additional nested `opt`, this indicates
* enable/disable status (e.g. `opt null` disables a feature while `null` leaves it untouched).
*/
export interface InternetIdentityInit {
/**
* Configuration to fetch root key or not from frontend assets
*/
'fetch_root_key' : [] | [boolean],
/**
* Configuration for OpenID Google client
*/
'openid_google' : [] | [[] | [GoogleOpenIdConfig]],
/**
* Configuration to set the canister as production mode.
* For now, this is used only to show or hide the banner.
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading