/
steamLogin.html
73 lines (66 loc) · 2.13 KB
/
steamLogin.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<html>
<head>
<title>Undecided Steam Login</title>
<style>
body {
font-family: sans-serif;
margin: 0;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background: #1b2838;
}
#header {
display: flex;
flex-direction: column;
align-items: center;
background: rgba( 0, 0, 0, 0.2 );
width: 100%;
color: white;
padding: 5vh;
}
#header > h2 {
color: #67c1f5;
}
button {
background: none;
border: none;
cursor: pointer;
}
</style>
</head>
<body>
<div id="header" style="display: none">
<h2>Copy the ID below into the Undecided Application:</h2>
<h3></h3>
</div>
<form action="https://steamcommunity.com/openid/login" method="post" id="login" style="display: none">
<input type="hidden" name="openid.identity" value="http://specs.openid.net/auth/2.0/identifier_select">
<input type="hidden" name="openid.claimed_id" value="http://specs.openid.net/auth/2.0/identifier_select">
<input type="hidden" name="openid.ns" value="http://specs.openid.net/auth/2.0">
<input type="hidden" name="openid.mode" value="checkid_setup">
<input type="hidden" name="openid.realm" value="https://jemsoftware.dev/steamLogin.html">
<input type="hidden" name="openid.return_to" value="https://jemsoftware.dev/steamLogin.html?page=graph">
<button type="submit" id="logon"><img src="https://community.akamai.steamstatic.com/public/images/signinthroughsteam/sits_02.png"></button>
</form>
</body>
<script>
window.onload = function() {
const params = new URLSearchParams(window.location.search);
if(params.get('openid.claimed_id') !== null) {
let steamID = params.get('openid.claimed_id').substring(37);
if(steamID !== null) {
document.getElementById('login').style.display = 'none';
let header = document.getElementById('header');
header.style.display = 'flex';
header.children[1].innerHTML = steamID;
}
}
else {
document.getElementById('logon').click();
document.getElementById('login').style.display = 'flex';
}
}
</script>
</html>