Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. (function () {
  2.  
  3. var config = JSON.parse(document.getElementById("config").innerHTML);
  4.  
  5. if (config.setCredentialToken) {
  6. var credentialToken = config.credentialToken;
  7. var credentialSecret = config.credentialSecret;
  8.  
  9. if (config.isCordova) {
  10. var credentialString = JSON.stringify({
  11. credentialToken: credentialToken,
  12. credentialSecret: credentialSecret
  13. });
  14.  
  15. window.location.hash = credentialString;
  16. }
  17.  
  18. if (window.opener && window.opener.Package &&
  19. window.opener.Package.oauth) {
  20. window.opener.Package.oauth.OAuth._handleCredentialSecret(
  21. credentialToken, credentialSecret);
  22. } else {
  23. try {
  24. localStorage[config.storagePrefix + credentialToken] = credentialSecret;
  25. } catch (err) {
  26. // We can't do much else, but at least close the popup instead
  27. // of having it hang around on a blank page.
  28. }
  29. }
  30. }
  31.  
  32. if (! config.isCordova) {
  33. document.getElementById("completedText").style.display = "block";
  34. document.getElementById("loginCompleted").onclick = function(){ window.close(); };
  35. window.close();
  36. }
  37. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement