33
0
mirror of https://github.com/joomla-extensions/patchtester.git synced 2024-12-22 10:58:58 +00:00

Implement clearer instructions for using Token Authentication

Signed-off-by: Roland Dalmulder <contact@rolandd.com>
This commit is contained in:
Roland Dalmulder 2020-04-03 21:00:49 +02:00
parent f70ea39171
commit 5d979880a7
No known key found for this signature in database
GPG Key ID: FD49814C56AE3AF9
3 changed files with 5 additions and 6 deletions

View File

@ -78,16 +78,14 @@ class FetchController extends AbstractController
{
$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);

View File

@ -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."

View File

@ -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 {