gitlab.html 717 B

1234567891011121314151617181920212223242526272829303132333435
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5. </head>
  6. <body>
  7. This window will be closed automatically.
  8. <script>
  9. if (window.opener != null && window.opener.onGitLabCallback != null)
  10. {
  11. try
  12. {
  13. var search = window.location.href;
  14. var idx1 = search.indexOf('access_token=');
  15. var code = null;
  16. if (idx1 >= 0)
  17. {
  18. var idx2 = search.indexOf('&', idx1);
  19. code = search.substring(idx1 + 13, idx2);
  20. }
  21. // Continues execution of main program flow
  22. window.opener.onGitLabCallback(code, window);
  23. window.close();
  24. }
  25. catch (e)
  26. {
  27. alert('GitLab error: ' + e.toString());
  28. window.close();
  29. }
  30. }
  31. </script>
  32. </body>
  33. </html>