Skip to content

Commit

Permalink
Merge pull request #36 from danvitoriano/1.0.6
Browse files Browse the repository at this point in the history
redirect to dashboard
  • Loading branch information
danvitoriano authored Nov 6, 2016
2 parents 2290781 + 96512a3 commit 652037f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 10 additions & 0 deletions dashboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>REST API Examples</title>
</head>
<body>
You are logged
</body>
</html>
7 changes: 3 additions & 4 deletions js/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@

var oAuthCodeGrant = function(){
var CLIENT_ID = "NhfvAEwAkCzlIzi2iH1NMcSylPTWTxPA";
var CLIENT_SECRET = "EZnBKz5mxenJpImttsl2o0aT9CvVXiD7Gqlsv1Hpno2BV4E2ICUU6w2p6spuw3Gf";
var REDIRECT_URI = "https://danvitoriano.github.io/rest-api-examples/index.html";
var CLIENT_SECRET = "Ckab1d-TB1WHPf_6vJs49DoqJmAOL8EqXup0zBovdinV4NuQVf0wZ39ANm9w_c5j";
var REDIRECT_URI = "https://danvitoriano.github.io/rest-api-examples/dashboard.html";
var lock = new Auth0Lock('NhfvAEwAkCzlIzi2iH1NMcSylPTWTxPA', 'danvitoriano.auth0.com');
// var REDIRECT_URI = http://localhost:3000/

Expand All @@ -191,12 +191,11 @@
console.log("Display user information");
var http = new XMLHttpRequest();
var idToken = window.localStorage.id_token;
var payload = "grant_type=authorization_code&code=" + idToken + "&redirect_uri=" + REDIRECT_URI + "&client_id=" + CLIENT_ID + "&client_secret=" + + CLIENT_SECRET;
var params = "grant_type=authorization_code&code=" + idToken + "&redirect_uri=" + REDIRECT_URI + "&client_id=" + CLIENT_ID + "&client_secret=" + + CLIENT_SECRET;
var url = "//danvitoriano.auth0.com/oauth/token";

http.open("POST", url, true);

http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

http.onload = function() {
Expand Down

0 comments on commit 652037f

Please sign in to comment.