2015-06-11 90 views
1

我跟着本教程,我無法弄清楚我做錯了什麼......這是行不通的。Parse.User.become未授權

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

我得到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 %> 

錯誤消息(返回Error.message)是 「未經授權」 的未經授權的錯誤。

我試圖找到文檔關於Parse.User.become功能來了解什麼是引擎蓋下發生的事情與沒有運氣...

會話令牌是不以任何解析數據類的容易找到。 ..

+0

你從哪裏得到會話令牌? – Wain

+0

它位於第169行的main.js中 - > res.render('store_auth',{sessionToken:user.getSessionToken()}); – Baral

回答

0

你很可能現在已經解決了這個問題,但爲了後代的緣故,我認爲這種情況發生的原因是沒有在head.ejs文件中設置Application ID和Javascript Key。