-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from companieshouse/feature/BI-3708
BI-3708 - Navigate to companies house log-in
- Loading branch information
Showing
19 changed files
with
353 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export const APP_NAME = 'example-ch-service-name' | ||
export const APP_NAME = 'dissolution-web' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import 'app/controllers/form.controller' | ||
import 'app/controllers/healthcheck.controller' | ||
import 'app/controllers/landing.controller' | ||
import 'app/controllers/landing.controller' | ||
import 'app/controllers/searchCompany.controller' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { controller, httpGet } from 'inversify-express-utils' | ||
|
||
import BaseController from 'app/controllers/base.controller' | ||
import { SEARCH_COMPANY_URI } from 'app/paths' | ||
import TYPES from 'app/types' | ||
|
||
@controller(SEARCH_COMPANY_URI, TYPES.SessionMiddleware, TYPES.AuthMiddleware) | ||
export class SearchCompanyController extends BaseController { | ||
|
||
@httpGet('') | ||
public async get(): Promise<string> { | ||
return super.render('search-company') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { NextFunction, Request, RequestHandler, Response } from 'express' | ||
import { AuthOptions } from 'web-security-node' | ||
|
||
import { SEARCH_COMPANY_URI } from 'app/paths' | ||
import UriFactory from 'app/utils/uri.factory' | ||
|
||
export default function AuthMiddleware(accountWebUrl: string, uriFactory: UriFactory, | ||
commonAuthMiddleware: (opts: AuthOptions) => RequestHandler): RequestHandler { | ||
return (req: Request, res: Response, next: NextFunction) => { | ||
const authOptions: AuthOptions = { | ||
returnUrl: uriFactory.createAbsoluteUri(req, SEARCH_COMPANY_URI), | ||
accountWebUrl | ||
} | ||
|
||
return commonAuthMiddleware(authOptions)(req, res, next) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Request } from 'express' | ||
import { provide } from 'inversify-binding-decorators' | ||
|
||
@provide(UriFactory) | ||
export default class UriFactory { | ||
public createAbsoluteUri(req: Request, path: string): string { | ||
return new URL(path, `${req.protocol}://${req.headers.host}`).href | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{% extends 'layout.njk' %} | ||
|
||
{% from 'govuk/components/breadcrumbs/macro.njk' import govukBreadcrumbs %} | ||
{% from 'govuk/components/button/macro.njk' import govukButton %} | ||
|
||
{% block pageTitle %} | ||
{{ serviceName }} | ||
{% endblock %} | ||
|
||
{% block beforeContent %} | ||
{{ | ||
govukBreadcrumbs({ | ||
items: [ | ||
{ href: 'https://www.gov.uk/', text: 'Home' }, | ||
{ href: 'https://www.gov.uk/browse/business', text: 'Business and self-employed' }, | ||
{ href: 'https://www.gov.uk/browse/business/limited-company', text: 'Running a limited company' } | ||
] | ||
}) | ||
}} | ||
{% endblock %} | ||
|
||
{% block content %} | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<h1 class="govuk-heading-xl">Search Company Placeholder</h1> | ||
</div> | ||
</div> | ||
{% endblock %} |
Oops, something went wrong.