Advertisement
Guest User

Untitled

a guest
Dec 14th, 2016
586
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Steem Connect</title>
  6. <script src="//cdn.steemjs.com/lib/latest/steemconnect.min.js"></script>
  7. </head>
  8. <body>
  9.  
  10. <script>
  11. steemconnect.init({
  12. app: 'krnel',
  13. callbackURL: 'http://localhost/'
  14. });
  15. var isAuth = false;
  16. var loginURL = steemconnect.getLoginURL();
  17.  
  18. steemconnect.isAuthenticated(function(err, result) {
  19. if (!err && result.isAuthenticated) {
  20. isAuth = true;
  21. var username = result.username;
  22. //do more
  23. console.log("logged in user: " + username);
  24. }
  25. });
  26.  
  27. function redirect() {
  28. window.location = loginURL;
  29. }
  30. </script>
  31.  
  32. <a href="#" onClick="redirect()">Log In</a>
  33. <a href="https://steemconnect.com/logout">Log Out</a>
  34.  
  35. </body>
  36. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement