-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebdea77
commit 78b060d
Showing
8 changed files
with
89 additions
and
2 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
19 changes: 19 additions & 0 deletions
19
app/controllers/simplified-account/settings/api-keys/revoke/revoke.controller.js
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,19 @@ | ||
const paths = require('@root/paths') | ||
const formatSimplifiedAccountPathsFor = require('@utils/simplified-account/format/format-simplified-account-paths-for') | ||
const { response } = require('@utils/response') | ||
const { getKeyByTokenLink } = require('@services/api-keys.service') | ||
|
||
async function get (req, res) { | ||
const tokenLink = req.params.tokenLink | ||
const apiKey = await getKeyByTokenLink(req.account.id, tokenLink) | ||
return response(req, res, 'simplified-account/settings/api-keys/revoke', { | ||
description: apiKey.description, | ||
backLink: formatSimplifiedAccountPathsFor(paths.simplifiedAccount.settings.apiKeys.index, req.service.externalId, req.account.type) | ||
}) | ||
} | ||
|
||
function post (req, res) { | ||
|
||
} | ||
|
||
module.exports = { get, post } |
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
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 |
---|---|---|
|
@@ -53,7 +53,7 @@ | |
text: 'Change name' | ||
}, | ||
{ | ||
href: '#', | ||
href: key.revokeKeyLink, | ||
text: 'Revoke' | ||
} | ||
] | ||
|
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,38 @@ | ||
{% extends "../settings-layout.njk" %} | ||
|
||
{% block settingsPageTitle %} | ||
API keys - revoke key | ||
{% endblock %} | ||
|
||
{% block settingsContent %} | ||
<form id="revoke-api-key" method="post" novalidate> | ||
<input id="csrf" name="csrfToken" type="hidden" value="{{ csrf }}"/> | ||
|
||
{{ govukRadios({ | ||
name: 'revokeApiKey', | ||
fieldset: { | ||
legend: { | ||
text: 'Are you sure you want to revoke ' + description, | ||
isPageHeading: true, | ||
classes: 'govuk-fieldset__legend--l govuk-!-font-weight-bold' | ||
} | ||
}, | ||
hint: { | ||
text: 'The key will stop working immediately. Any integration you’ve created will no longer work.' | ||
}, | ||
items: [ | ||
{ | ||
value: 'Yes', | ||
text: 'Yes' | ||
}, | ||
{ | ||
value: 'No', | ||
text: 'No' | ||
} | ||
] | ||
}) }} | ||
{{ govukButton({ | ||
text: 'Save changes' | ||
}) }} | ||
</form> | ||
{% endblock %} |