<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.1.4/js.cookie.min.js" integrity="sha256-NjbogQqosWgor0UBdCURR5dzcvAgHnfUZMcZ8RCwkk8=" crossorigin="anonymous"></script>

<script type="text/javascript">
    $(document).ready(function() {
        var access_token = Cookies.get("access_token");

        if (access_token === undefined) {
            // if a token hasn't been generated by the user yet, we need one
            window.location = "https://www.reddit.com/api/v1/authorize?client_id=-EFn6NcK09KFyw&response_type=token&state=scuffed&redirect_uri=https://redditdownloader.github.io/auth&scope=read";
        } else {
            alert("Your access token is: " + access_token);
        }
    });
</script>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.1.4/js.cookie.min.js" integrity="sha256-NjbogQqosWgor0UBdCURR5dzcvAgHnfUZMcZ8RCwkk8=" crossorigin="anonymous"></script>

<script type="text/javascript">
    var CLIENT_ID = "-EFn6NcK09KFyw";
    var REDIRECT_URI = "https://redditdownloader.github.io/auth";

    $(document).ready(function() {
        var access_token = Cookies.get("access_token");

        if (access_token === undefined) {
            // if a token hasn't been generated by the user yet, we need one
            window.location = "https://www.reddit.com/api/v1/authorize?client_id=" + CLIENT_ID + "&response_type=token&state=scuffed&redirect_uri=" + REDIRECT_URI + "&scope=read";
        } else {
            alert("Your access token is: " + access_token);
        }
    });
</script>
</body>
</html>

Break out URL params into constant variables
Break out URL params into constant variables

