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
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ export interface DocumentCaptureNotReadyProps {
function DocumentCaptureNotReady({ navigate }: DocumentCaptureNotReadyProps) {
const { t } = useI18n();
const { trackEvent } = useContext(AnalyticsContext);
const { currentStep } = useContext(FlowContext);
const { currentStep, accountURL } = useContext(FlowContext);
const { name: spName, failureToProofURL } = useContext(ServiceProviderContext);
const appName = getConfigValue('appName');
const handleExit = () => {
trackEvent('IdV: docauth not ready link clicked');
forceRedirect(
addSearchParams(spName ? failureToProofURL : '/account', {
addSearchParams(spName ? failureToProofURL : accountURL, {
step: currentStep,
location: 'not_ready',
}),
Expand Down
1 change: 1 addition & 0 deletions app/javascript/packages/verify-flow/cancel.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe('Cancel', () => {
const { getByText } = render(
<FlowContext.Provider
value={{
accountURL: 'http://example.test/account',
cancelURL: 'http://example.test/cancel',
exitURL: 'http://example.test/exit',
currentStep: 'one',
Expand Down
5 changes: 5 additions & 0 deletions app/javascript/packages/verify-flow/context/flow-context.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { createContext } from 'react';

export interface FlowContextValue {
/**
* URL to the path of the account home
*/
accountURL: string;
/**
* URL to path for session cancel.
*/
Expand All @@ -18,6 +22,7 @@ export interface FlowContextValue {
}

const FlowContext = createContext<FlowContextValue>({
accountURL: '',
cancelURL: '',
exitURL: '',
currentStep: '',
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/packs/document-capture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const {
flowPath,
cancelUrl: cancelURL,
exitUrl: exitURL,
accountUrl: accountURL,
idvInPersonUrl: inPersonURL,
securityAndPrivacyHowItWorksUrl: securityAndPrivacyHowItWorksURL,
inPersonFullAddressEntryEnabled,
Expand Down Expand Up @@ -158,6 +159,7 @@ const App = composeComponents(
FlowContext.Provider,
{
value: {
accountURL,
cancelURL,
exitURL,
currentStep: 'document_capture',
Expand Down
1 change: 1 addition & 0 deletions app/views/idv/shared/_document_capture.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
flow_path: flow_path,
cancel_url: idv_cancel_path(step: :document_capture),
exit_url: idv_exit_path,
account_url: account_path,
failure_to_proof_url: failure_to_proof_url,
idv_in_person_url: (IdentityConfig.store.in_person_doc_auth_button_enabled && Idv::InPersonConfig.enabled_for_issuer?(decorated_sp_session.sp_issuer)) ? idv_in_person_url : nil,
security_and_privacy_how_it_works_url: MarketingSite.security_and_privacy_how_it_works_url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ describe('DocumentCaptureNotReady', () => {
<FlowContext.Provider
value={{
currentStep: 'document_capture',
accountURL: '/account',
cancelURL: '',
exitURL: '',
}}
Expand Down Expand Up @@ -89,6 +90,7 @@ describe('DocumentCaptureNotReady', () => {
<FlowContext.Provider
value={{
currentStep: 'document_capture',
accountURL: '/account',
cancelURL: '',
exitURL: '',
}}
Expand Down