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
17					if (idx1 >= 0)
18					{
19            			var idx2 = search.indexOf('&', idx1);
20						code = search.substring(idx1 + 13, idx2);
21					}
22
23					// Continues execution of main program flow
24					window.opener.onGitLabCallback(code, window);
25					window.close();
26				}
27				catch (e)
28				{
29					alert('GitLab error: ' + e.toString());
30					window.close();
31				}
32			}
33		</script>
34	</body>
35</html>