<commit_before><?php
/**
 * Login with Amazon
 *
 * @category    Amazon
 * @package     Amazon_Login
 * @copyright   Copyright (c) 2014 Amazon.com
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>

<?php
/**
 * Authorize JavaScript only used for full-page redirect
 */
?>

<div id="amazon-root"></div>

<script type='text/javascript'>
function getURLParameter(name, source) {
    return decodeURIComponent((new RegExp('[?|&|#]' + name + '=' +
                    '([^&;]+?)(&|#|;|$)').exec(source)||[,""])[1].replace(/\+/g,
                '%20'))||null;}

var accessToken = getURLParameter("access_token", location.hash);

if (typeof accessToken === 'string' && accessToken.match(/^Atza/)) {
    document.cookie = "amazon_Login_accessToken=" + accessToken + "; secure";
    window.location.replace(window.location.pathname + '?nopopup=1&access_token=' + accessToken);
}

</script><commit_msg>fix non-popup/full-page redirect login access token cookie<commit_after><?php
/**
 * Login with Amazon
 *
 * @category    Amazon
 * @package     Amazon_Login
 * @copyright   Copyright (c) 2014 Amazon.com
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>

<?php
/**
 * Authorize JavaScript only used for full-page redirect
 */
?>

<div id="amazon-root"></div>

<script type='text/javascript'>
function getURLParameter(name, source) {
    return decodeURIComponent((new RegExp('[?|&|#]' + name + '=' +
                    '([^&;]+?)(&|#|;|$)').exec(source)||[,""])[1].replace(/\+/g,
                '%20'))||null;}

var accessToken = getURLParameter("access_token", location.hash);

if (typeof accessToken === 'string' && accessToken.match(/^Atza/)) {
    document.cookie = "amazon_Login_accessToken=" + accessToken + "; path=/";
    window.location.replace(window.location.pathname + '?nopopup=1&access_token=' + accessToken);
}

</script>
{'fraction_non_alphanumeric': 0.19854847071021253, 'fraction_numerical': 0.012441679626749611, 'mean_word_length': 3.7890818858560795, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1376035', 'n_tokens_mistral': 644, 'n_tokens_neox': 626, 'n_words': 121}