Skip to content

Commit

Permalink
Remove account creation routes under one login (#2751)
Browse files Browse the repository at this point in the history
* Account creation routes removed.

* Logging Fixes

* Fix up one of the failing UI tests.

* Two more UI test fixes
  • Loading branch information
cooperaj authored Aug 27, 2024
1 parent 71047c0 commit b29f175
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 7 deletions.
37 changes: 34 additions & 3 deletions service-front/app/config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,40 @@
$app->get('/contact-us', Common\Handler\ContactUsPageHandler::class, 'contact-us');

// User creation
$app->route('/create-account', Actor\Handler\CreateAccountHandler::class, ['GET', 'POST'], 'create-account');
$app->get('/create-account-success', Actor\Handler\CreateAccountSuccessHandler::class, 'create-account-success');
$app->get('/activate-account/{token}', Actor\Handler\ActivateAccountHandler::class, 'activate-account');
$app->route(
'/create-account',
new ConditionalRoutingMiddleware(
$container,
$factory,
$ALLOW_GOV_ONE_LOGIN,
Common\Handler\GoneHandler::class,
Actor\Handler\CreateAccountHandler::class,
),
['GET', 'POST'],
'create-account'
);
$app->get(
'/create-account-success',
new ConditionalRoutingMiddleware(
$container,
$factory,
$ALLOW_GOV_ONE_LOGIN,
Common\Handler\GoneHandler::class,
Actor\Handler\CreateAccountSuccessHandler::class,
),
'create-account-success'
);
$app->get(
'/activate-account/{token}',
new ConditionalRoutingMiddleware(
$container,
$factory,
$ALLOW_GOV_ONE_LOGIN,
fn () => new \Laminas\Diactoros\Response\RedirectResponse('/home'),
Actor\Handler\ActivateAccountHandler::class,
),
'activate-account'
);

// User auth
$app->route('/login', [
Expand Down
9 changes: 8 additions & 1 deletion service-front/app/features/actor-privacy-notice.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ Feature: View privacy notice from the terms of use page
I want to check the privacy notice
So that I can understand how my private data will be handled by the service

@ui
@ui @ff:allow_gov_one_login:false
Scenario: user wants to see the privacy notice
Given I am on the create account page
When I request to see the actor terms of use
And I request to see the actor privacy notice
Then I can see the actor privacy notice

@ui @ff:allow_gov_one_login:true
Scenario: user wants to see the privacy notice
Given I am on the one login page
When I request to see the actor terms of use
And I request to see the actor privacy notice
Then I can see the actor privacy notice

@ui
Scenario: Actor can access the actor cookies page from the actor privacy notice page
Given I am on the actor privacy notice page
Expand Down
8 changes: 7 additions & 1 deletion service-front/app/features/actor-terms-of-use.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ Feature: View terms of use from create account page
I want to check the terms of use
So that I can be be sure of my rights and responsibilities for using the service

@ui
@ui @ff:allow_gov_one_login:false
Scenario: The user can access the terms of use from the create account page
Given I am on the create account page
When I request to see the actor terms of use
Then I can see the actor terms of use

@ui @ff:allow_gov_one_login:true
Scenario: The user can access the terms of use from the one login page
Given I am on the one login page
When I request to see the actor terms of use
Then I can see the actor terms of use

@ui
Scenario: Actor can access the actor cookies page from the actor terms of use page
Given I am on the actor terms of use page
Expand Down
2 changes: 1 addition & 1 deletion service-front/app/features/common-language.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Feature: The application supports Welsh as a language
And I request to view the content in english
Then I should be on the home page of the service

@ui @welsh
@ui @welsh @ff:allow_gov_one_login:false
Scenario: Users can expect to receive notification emails in the language they are viewing
Given I prefix a url with the welsh language code
And I am not a user of the lpa application
Expand Down
6 changes: 5 additions & 1 deletion service-front/app/features/context/UI/AccountContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -1801,7 +1801,11 @@ public function iRequestToSeeTheActorPrivacyNoticePage(): void
*/
public function iRequestToSeeTheActorTermsOfUse(): void
{
$this->ui->clickLink('terms of use');
if (($this->base->container->get(FeatureEnabled::class))('allow_gov_one_login')) {
$this->ui->clickLink('terms of the Use a lasting power of attorney service.');
} else {
$this->ui->clickLink('terms of use');
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ public function handlePost(
$this->logger->notice(
'Account with Id {id} added LPA of type {lpaType} to their account',
[
'id' => $this->identity,
'event_code' => $lpaType === 'health and welfare'
? EventCodes::ADDED_LPA_TYPE_HW
: EventCodes::ADDED_LPA_TYPE_PFA,
Expand Down

0 comments on commit b29f175

Please sign in to comment.