Skip to content

Commit

Permalink
DIG-4670: (BUG) Registration workflow makes people enter 2nd factor t…
Browse files Browse the repository at this point in the history
…wice PROD
  • Loading branch information
phillipbentonkelly committed Aug 6, 2024
1 parent 1ea719d commit 4417545
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ test.only('Device registration', async t => {

const donePage = new PageModel();
await t
.expect(donePage.sectionHeader.withText('YOU’RE ALL SET!').exists)
// .expect(donePage.sectionHeader.withText('YOU’RE ALL SET!').exists)
.expect(donePage.sectionHeader.withText('JUST A MOMENT!').exists)
.ok('On done page');

// Now we go home to make sure that the session was destroyed. This should
Expand Down
51 changes: 44 additions & 7 deletions services-js/access-boston/src/pages/done.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
import React from 'react';
// import React, {useState, useRef, useEffect } from 'react';
import Head from 'next/head';

import { SectionHeader, PUBLIC_CSS_URL } from '@cityofboston/react-fleet';

import AppWrapper from '../client/common/AppWrapper';

export default class DonePage extends React.Component {
interface Props {}
interface State {
acctFetched: boolean;
}

export default class DonePage extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = { acctFetched: false };
}

async componentDidMount() {
// TODO: DIG-4670: (BUG) Registration Workflow
// THIS IS PACK TO THIS BUG, PROPER FIX NEEDS TO HAPPEN ON
// THE SECURITY TEAMS Servers ...
// Error = User CRUD update is slow to be available on the endpoint (api)
const delay = async (ms: number) => {
return new Promise(resolve => setTimeout(resolve, ms));
};

await delay(13000);
this.setState({ acctFetched: true });
}

render() {
const { acctFetched } = this.state;

const headerTxt = acctFetched ? 'You’re all set!' : 'Just a moment!';
const loginTxt = acctFetched
? `Log in now to
continue.`
: `You can use the button below to Log in a moment.`;

return (
<>
<Head>
Expand All @@ -16,17 +48,22 @@ export default class DonePage extends React.Component {

<AppWrapper>
<div className="b b-c b-c--hsm">
<SectionHeader title="You’re all set!" />
<SectionHeader title={headerTxt} />

<div className="t--intro m-v500">
You’re now set up with your Access Boston account. Log in now to
continue.
You’re now set up with your Access Boston account. {loginTxt}
</div>

<div className="ta-r">
<a href="/" className="btn">
Log In
</a>
{acctFetched ? (
<a href="/" className="btn">
Log In
</a>
) : (
<button className={`btn`} aria-disabled disabled>
Log In
</button>
)}
</div>
</div>
</AppWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4168,25 +4168,27 @@ exports[`Storyshots DonePage default 1`] = `
>
<h2
className="sh-title"
id="sh-2018125994"
id="sh-203550349"
>
You’re all set!
Just a moment!
</h2>
</div>
<div
className="t--intro m-v500"
>
You’re now set up with your Access Boston account. Log in now to continue.
You’re now set up with your Access Boston account.
You can use the button below to Log in a moment.
</div>
<div
className="ta-r"
>
<a
<button
aria-disabled={true}
className="btn"
href="/"
disabled={true}
>
Log In
</a>
</button>
</div>
</div>
</main>
Expand Down

0 comments on commit 4417545

Please sign in to comment.