Skip to content

Commit

Permalink
Implement clearer instructions for using Token Authentication
Browse files Browse the repository at this point in the history
Signed-off-by: Roland Dalmulder <contact@rolandd.com>
  • Loading branch information
roland-d committed Apr 3, 2020
1 parent f70ea39 commit 5d97988
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,14 @@ public function execute()
{
$session->set('com_patchtester_fetcher_page', $status['page']);

$message = Text::sprintf('COM_PATCHTESTER_FETCH_PAGE_NUMBER', $status['page']);

if ($session->has('com_patchtester_fetcher_last_page'))
{
$message = Text::sprintf(
'COM_PATCHTESTER_FETCH_PAGE_NUMBER_OF_TOTAL', $status['page'], $session->get('com_patchtester_fetcher_last_page')
);
}
else
{
$message = Text::sprintf('COM_PATCHTESTER_FETCH_PAGE_NUMBER', $status['page']);
}
}

$response = new JsonResponse($status, $message, false, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ COM_PATCHTESTER_FIELD_GH_AUTH_LABEL="GitHub Authentication Method"
COM_PATCHTESTER_FIELD_GH_AUTH_OPTION_CREDENTIALS="Credentials"
COM_PATCHTESTER_FIELD_GH_AUTH_OPTION_TOKEN="Token"
COM_PATCHTESTER_FIELD_GH_PASSWORD_LABEL="GitHub Account Password"
COM_PATCHTESTER_FIELD_GH_PASSWORD_DESC="Password for the account entered in the 'GitHub Account Username' field. Note that accounts using Two Factor Authentication will not work with username and password authentication."
COM_PATCHTESTER_FIELD_GH_TOKEN_DESC="Use this field to input a GitHub API Token in place of your username and password. Note that this is required if your account has Two Factor Authentication enabled."
COM_PATCHTESTER_FIELD_GH_PASSWORD_DESC="Password for the account entered in the 'GitHub Account Username' field. Note that accounts using Two Factor Authentication will not work with username and password authentication.<p><span class=""alert-danger"">GitHub will discontinue the use of username and password on of November 13, 2020 at 4:00 PM UTC. It is highly recommended to use the Token Authentication Method</span></p>"
COM_PATCHTESTER_FIELD_GH_TOKEN_DESC="Use this field to input a GitHub API Token in place of your username and password. Note that this is required if your account has Two Factor Authentication enabled.<p></p>To setup an access token, follow these steps.<ol><li><a href=""https://github.com/settings/tokens/new?description=Joomla%20PatchTester&scopes=public_repo,repo:status"">Create a Personal Access Token</a></li><li>Click <span class=""font-weight-bold"">Generate token</span> at the bottom of the page</li><li>At the top in the green bar you will find your access token</li><li>Copy the token by selecting it or clicking on the clipboard</li><li>Paste the token in the <span class=""font-weight-bold"">GitHub Token</span> field above</li><li>Save the changes by clicking the <span class=""font-weight-bold"">Save</span> button at the top</li><li>You can now use the Patch Tester with your token</li></ol><p>You can always revoke access by deleting the Personal access token from the <a href=""https://github.com/settings/tokens"">Personal access tokens on Github</a>.</p>"
COM_PATCHTESTER_FIELD_GH_TOKEN_LABEL="GitHub Token"
COM_PATCHTESTER_FIELD_GH_USER_LABEL="GitHub Account Username"
COM_PATCHTESTER_FIELD_GH_USER_DESC="Name of account on GitHub to use to authenticate to the API."
Expand Down
1 change: 1 addition & 0 deletions media/com_patchtester/js/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ if (typeof Joomla === 'undefined') {
getRequest('fetch');
} else {
jQuery('#progress').remove();
jQuery('#modal-refresh button.close', window.parent.document).trigger('click');
}
} catch (error) {
try {
Expand Down

0 comments on commit 5d97988

Please sign in to comment.