Skip to content

Commit

Permalink
Merge pull request #6 from akunzai/remove-jwt-verification
Browse files Browse the repository at this point in the history
Remove jwt verification
  • Loading branch information
akunzai committed Jun 7, 2024
2 parents 604027d + b78d755 commit aa307bf
Show file tree
Hide file tree
Showing 6 changed files with 277 additions and 122 deletions.
114 changes: 36 additions & 78 deletions login.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,92 +3,30 @@

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="-1" />
<title>Internet Hotspot > login</title>
<style type="text/css">
body {
color: #737373;
font-size: 10px;
font-family: verdana;
}

textarea,
input,
select {
background-color: #FDFBFB;
border: 1px solid #BBBBBB;
padding: 2px;
margin: 1px;
font-size: 14px;
color: #808080;
}

a,
a:link,
a:visited,
a:active {
color: #AAAAAA;
text-decoration: none;
font-size: 10px;
}

a:hover {
border-bottom: 1px dotted #c1c1c1;
color: #AAAAAA;
}

img {
border: none;
}

td {
font-size: 14px;
color: #7A7A7A;
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Internet Hotspot - Log in</title>
<link rel="stylesheet" href="css/style.css">
</head>

<body>
<table id="root" width="100%" style="margin-top: 10%;">
<tr>
<td align="center" valign="middle">
<div class="notice" style="color: #c1c1c1; font-size: 9px">Please log on to use the internet hotspot
service<br /></div><br />
<table width="280" height="280" style="border: 1px solid #cccccc; padding: 0px;" cellpadding="0"
cellspacing="0">
<tr>
<td align="center" valign="bottom" height="175" colspan="2">
<form>
<table width="100" style="background-color: #ffffff">
<tr>
<td>&nbsp;</td>
<td><input type="submit" value="Refresh" onclick="onClickRefresh" /></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td align="center"><a href="http://www.mikrotik.com" target="_blank" style="border: none;">
<img src="/img/logobottom.png" alt="mikrotik" /></a></td>
</tr>
</table>

<br />
<div style="color: #c1c1c1; font-size: 9px">Powered by MikroTik RouterOS</div>
<div id="error"></div>
</td>
</tr>
</table>
<form name="sendin" action="$(link-login-only)" method="post">
<!-- two other colors
<body class="lite">
<body class="dark">
-->
<form name="sendin" action="$(link-login-only)" method="post" style="display:none">
<input type="hidden" name="username" />
<input type="hidden" name="password" />
<input type="hidden" name="dst" value="$(link-orig)" />
<input type="hidden" name="popup" value="true" />
</form>
<script type="module" src="/src/index.js"></script>
<script src="/md5.js"></script>
<script>
// https://help.mikrotik.com/docs/display/ROS/Hotspot+customisation
// Common server variables
Expand Down Expand Up @@ -116,17 +54,37 @@
document.sendin.dst.value = linkOrig;
var psw = password;
if (chapId) {
psw = md5(chapId + password + chapChallenge);
psw = hexMD5(chapId + password + chapChallenge);
}
document.sendin.password.value = psw;
document.sendin.submit();
return false;
}

function onClickRefresh() {
window.location.reload();
}
</script>
<div class="ie-fixMinHeight">
<div class="main">
<div class="wrap animated fadeIn">
<form name="login" action="$(link-login-only)" method="post" onSubmit="javascript:window.location.reload(); return false">
<input type="hidden" name="dst" value="$(link-orig)" />
<input type="hidden" name="popup" value="true" />
<svg class="logo" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 174 42">
<path fill="#fff" d="M7.32 13.66L0 41.74 3.12 41.74 9.49 15.94 9.58 15.94 15.01 41.74 18.22 41.74 36.86 16.34 36.95 16.34 30.02 41.74 33.18 41.74 40.4 13.66 35.73 13.66 17.23 38.87 11.99 13.66 7.32 13.66zM43.43 21.45L38.19 41.74 41.16 41.74 46.4 21.45 43.43 21.45zM50.68 21.45L45.5 41.74 48.47 41.74 50.36 34.39 55.55 30.77 62.02 41.74 65.27 41.74 57.91 29.28 69.43 21.45 65.46 21.45 51.21 31.36 51.12 31.28 53.66 21.45 50.68 21.45z" />
<path d="M71.18 21.45L65.94 41.74h3l2.74-10.62c1-3.81 3.82-7.39 9.16-7.47.56 0 1.13 0 1.7 0l.66-2.48c-.52 0-1.09 0-1.61 0-4.34 0-6.94 2-8.82 5h-.1l1.23-4.68zM103.8 28.8c0-5-4-7.94-9.63-7.94-8.69 0-13.59 6.37-13.59 13 0 5.07 3.44 8.45 9.72 8.45 9 0 13.5-6.68 13.5-13.53m-3 .52c0 4.72-3.44 10.93-9.95 10.93-5 0-7.32-2.68-7.32-6.61 0-4.76 3.59-10.7 10.1-10.7 4.77 0 7.17 2.6 7.17 6.38M132.33 21.43L134.26 13.66 105.19 13.66 103.27 21.45 112.59 21.45 112.59 21.45 122.99 21.45 122.99 21.45 132.33 21.43zM111.67 25.17L107.55 41.74 117.93 41.74 122.06 25.17 122.06 25.16 111.67 25.16 111.67 25.17zM134 25.17l-4.11 16.57h9.35l4.1-16.57zm10.28-3.73l1.94-7.78h-9.34l-2 7.79zM150.09 13.66L143.11 41.74 152.45 41.74 153.91 35.92 156.04 34.34 159.34 41.74 169.49 41.74 163.26 29.55 174.26 21.33 163.07 21.33 156.18 27.3 156.09 27.3 159.44 13.66 150.09 13.66zM47.45 0c1.14 7.93 5.39 12.74 14.07 13.14A10.69 10.69 0 0 1 47.45 0" fill="#fff" fill-rule="evenodd" />
<path d="M42.91,1.4c.1,0,.11,0,.12.11A16.55,16.55,0,0,0,48.26,13a16.6,16.6,0,0,0,12,4.66c-10,4-20.55-5.6-17.33-16.28" fill="#fff" fill-rule="evenodd" /></svg>


<p class="info">
Please log in to use the internet hotspot service
</p>
<input type="submit" value="Refresh" />

</form>
<p class="info bt">Powered by MikroTik RouterOS</p>

</div>
</div>
</div>
</body>

</html>
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "hotspot-login-page",
"version": "2.1.0",
"version": "2.1.1",
"type": "module",
"private": true,
"packageManager": "pnpm@9.1.4",
"packageManager": "pnpm@9.2.0",
"description": "hotspot login page to work with keycloak",
"main": "src/index.js",
"scripts": {
Expand All @@ -14,8 +14,6 @@
"lint:fix": "eslint --fix ./src/"
},
"dependencies": {
"blueimp-md5": "^2.19.0",
"jose": "^5.3.0",
"keycloak-js": "24.0.4"
},
"devDependencies": {
Expand Down
16 changes: 0 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions public/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit aa307bf

Please sign in to comment.