|
@@ -2,14 +2,14 @@
|
2
|
2
|
<head>
|
3
|
3
|
<meta charset="utf-8" />
|
4
|
4
|
<script>
|
5
|
|
-var domain = ''; // hostname ending in '.auth0.com'
|
|
5
|
+var authUrl = 'https://php-crud-api.auth0.com/authorize'; // hostname ending in '.auth0.com'
|
6
|
6
|
var clientId = ''; // client id as defined in auth0
|
7
|
7
|
var audience = ''; // api audience as defined in auth0
|
8
|
8
|
window.onload = function () {
|
9
|
9
|
var match = RegExp('[#&]access_token=([^&]*)').exec(window.location.hash);
|
10
|
10
|
var accessToken = match && decodeURIComponent(match[1].replace(/\+/g, ' '));
|
11
|
11
|
if (!accessToken) {
|
12
|
|
- document.location = 'https://'+domain+'/authorize?audience='+audience+'&response_type=token&client_id='+clientId+'&redirect_uri='+document.location.href;
|
|
12
|
+ document.location = authUrl+'?audience='+audience+'&response_type=token&client_id='+clientId+'&redirect_uri='+document.location.href;
|
13
|
13
|
} else {
|
14
|
14
|
document.location.hash = '';
|
15
|
15
|
var req = new XMLHttpRequest();
|