Baral
Baral

Reputation: 3141

Parse.User.become unauthorized

I followed this tutorial and I cannot figure out what i am doing wrong... It's not working.

Tutorial: https://parse.com/tutorials/adding-third-party-authentication-to-your-web-app

I get an unauthorized error in store_auth.ejs

<% include head %>
<p>Saving your GitHub session...<%= sessionToken %></p>
<script type="text/javascript">
Parse.User.become('<%= sessionToken %>').then(function (user) {
  window.location.href='/main';
},
function (error) {
  alert('Login with GitHub Failed. ' + error.message + ' thats it!');
  window.location.href='/';
});
</script>
<% include foot %>

The error message (error.message) is "unauthorized".

I tried to find documentation regarding the Parse.User.become function to understand what is going on under the hood with no luck...

The session token is not findable in any of the Parse Data Classes...

Upvotes: 1

Views: 312

Answers (1)

Scott H
Scott H

Reputation: 1529

Most likely you have solved this by now, but for posterities sake, I think the reason why this was occurring was failing to set the Application ID and Javascript Key in the head.ejs file.

Upvotes: 0

Related Questions