Compare commits
No commits in common. "13b91d99166c9d0b32b1c52067272fa30f9acb5c" and "6eb9e7631609b6c99e0f3555783fb53c77ba363f" have entirely different histories.
13b91d9916
...
6eb9e76316
19 changed files with 61 additions and 283 deletions
|
@ -24,8 +24,6 @@ Then, build the server:
|
||||||
./build.sh
|
./build.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
After that, configure the server using the `config.json` file (see below), and you're ready to go!
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
To run the server, simply run the binary:
|
To run the server, simply run the binary:
|
||||||
```sh
|
```sh
|
||||||
|
@ -33,7 +31,7 @@ To run the server, simply run the binary:
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
The server can be configured using a `config.json` file. An example configuration file is provided in the repository as `config.json.example`. The configuration file is structured as follows:
|
The server can be configured using a `config.json` file. An example configuration file is provided in the repository.
|
||||||
### Global
|
### Global
|
||||||
- `port` - The port the server listens on
|
- `port` - The port the server listens on
|
||||||
- `ip` - The IP address the server listens on
|
- `ip` - The IP address the server listens on
|
||||||
|
|
|
@ -1,16 +1,4 @@
|
||||||
@font-face {
|
@import url("../fonts/inter.css");
|
||||||
font-family: 'Figtree';
|
|
||||||
src: url("fonts/Figtree.woff2") format("woff2");
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
html {
|
|
||||||
background: linear-gradient(to top left, rgb(217, 236, 255), rgb(228, 249, 255), rgb(221, 255, 238), rgb(249,255,253)) no-repeat center center fixed;
|
|
||||||
-webkit-background-size: cover;
|
|
||||||
-moz-background-size: cover;
|
|
||||||
-o-background-size: cover;
|
|
||||||
background-size: cover;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--invertdm: 0%;
|
--invertdm: 0%;
|
||||||
|
@ -78,16 +66,17 @@ p#statusBox {
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background-color: var(--editor);
|
background-color: var(--editor);
|
||||||
font-family: "Figtree", sans-serif;
|
font-family: "Inter", sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sign up/log in div */
|
/* Sign up/log in div */
|
||||||
|
|
||||||
.inOutDiv {
|
.inOutDiv {
|
||||||
border-radius: 25px;
|
border-radius: 8px;
|
||||||
margin: 10%;
|
margin: 10%;
|
||||||
|
padding: 30px;
|
||||||
|
border: solid 1px var(--border-color);
|
||||||
background-color: var(--inOutDiv);
|
background-color: var(--inOutDiv);
|
||||||
padding: 35px 35px 50px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
|
@ -98,14 +87,14 @@ input {
|
||||||
width: calc(100% - 35px);
|
width: calc(100% - 35px);
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
height: 35px;
|
height: 30px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
|
|
||||||
border: solid;
|
border: solid;
|
||||||
border-color: var(--border-color);
|
border-color: var(--border-color);
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
border-radius: 5px;
|
border-radius: 8px;
|
||||||
min-width: 20px;
|
min-width: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,6 +157,9 @@ input {
|
||||||
.inOutDiv p {
|
.inOutDiv p {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
.inOutDiv h2 {
|
||||||
|
font-size: 21px;
|
||||||
|
}
|
||||||
.background {
|
.background {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -209,24 +201,27 @@ input {
|
||||||
|
|
||||||
.newOauth, .oauthList, .sessionEntry, .oauthEntry {
|
.newOauth, .oauthList, .sessionEntry, .oauthEntry {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
width: calc(100% - 17.5vh);
|
||||||
margin-top: 7vh;
|
margin-top: 7vh;
|
||||||
margin-left: 7vh;
|
margin-left: 7vh;
|
||||||
margin-right: 7vh;
|
margin-right: 7vh;
|
||||||
padding: 15px 10px 30px;
|
padding: 15px 10px 30px;
|
||||||
|
border-style: solid;
|
||||||
border-image: none;
|
border-image: none;
|
||||||
border-radius: 25px;
|
border-radius: 8px;
|
||||||
|
border-width: 1px;
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
background-color: var(--inOutDiv);
|
background-color: var(--inOutDiv);
|
||||||
|
border-color: var(--border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.oauthEntry, .sessionEntry {
|
.oauthEntry, .sessionEntry {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 20px;
|
padding: 5px;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
border: 3px dotted var(--border-color);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.oauthEntry button, .sessionEntry button {
|
.oauthEntry button, .sessionEntry button {
|
||||||
|
@ -292,9 +287,8 @@ button:hover {
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: 10px;
|
margin-top: 20px;
|
||||||
font-weight: 600;
|
font-weight: 300;
|
||||||
font-size: 22px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.inOutDiv a {
|
.inOutDiv a {
|
||||||
|
@ -302,6 +296,21 @@ h2 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.background {
|
||||||
|
position: fixed;
|
||||||
|
z-index: -2;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
-webkit-user-drag: none;
|
||||||
|
user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
.vAlign {
|
.vAlign {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -347,82 +356,3 @@ h2 {
|
||||||
.w900 {
|
.w900 {
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* swipe animation */
|
|
||||||
.swipe {
|
|
||||||
pointer-events: none;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100vw;
|
|
||||||
height: 100vh;
|
|
||||||
background-color: #fff;
|
|
||||||
animation: swipe 0.2s forwards;
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swipe-animate {
|
|
||||||
display: initial;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* swipe-out animation */
|
|
||||||
.swipe-out {
|
|
||||||
pointer-events: none;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100vw;
|
|
||||||
height: 100vh;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swipe-out-animate {
|
|
||||||
animation: swipe-out 0.2s forwards;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes swipe {
|
|
||||||
0% {
|
|
||||||
transform: translateX(-100%);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
transform: translateX(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes swipe-out {
|
|
||||||
0% {
|
|
||||||
transform: translateX(0);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
transform: translateX(100%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes swipe-reduced {
|
|
||||||
0% {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes swipe-out-reduced {
|
|
||||||
0% {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
|
||||||
.swipe {
|
|
||||||
animation: swipe-reduced 0.5s forwards;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swipe-out {
|
|
||||||
animation: swipe-out-reduced 0.5s forwards;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -12,8 +12,9 @@
|
||||||
<body>
|
<body>
|
||||||
<span id="passThrough" style="display: none;">{{ .name }}</span>
|
<span id="passThrough" style="display: none;">{{ .name }}</span>
|
||||||
<span id="autoAccept" style="display: none;">0</span>
|
<span id="autoAccept" style="display: none;">0</span>
|
||||||
|
<img src="/static/img/background.png" class="background" alt="">
|
||||||
<div class="inOutDiv">
|
<div class="inOutDiv">
|
||||||
<h2>Authorise Application</h2>
|
<h2 class="w300">Authorise Application</h2>
|
||||||
<p id="statusBox">Loading...</p>
|
<p id="statusBox">Loading...</p>
|
||||||
<br>
|
<br>
|
||||||
<div style="display: flex;justify-content: center;">
|
<div style="display: flex;justify-content: center;">
|
||||||
|
@ -23,8 +24,6 @@
|
||||||
<br>
|
<br>
|
||||||
<a href="/dashboard">Return to Dashboard</a>
|
<a href="/dashboard">Return to Dashboard</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="swipe" class="swipe"></div>
|
|
||||||
<div id="swipe-out" class="swipe-out"></div>
|
|
||||||
<script>
|
<script>
|
||||||
loadWasm("/static/wasm/authorize.wasm")
|
loadWasm("/static/wasm/authorize.wasm")
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -12,15 +12,14 @@
|
||||||
<body>
|
<body>
|
||||||
<span id="passThrough" style="display: none;">{{ .name }}</span>
|
<span id="passThrough" style="display: none;">{{ .name }}</span>
|
||||||
<span id="autoAccept" style="display: none;">1</span>
|
<span id="autoAccept" style="display: none;">1</span>
|
||||||
|
<img src="/static/img/background.png" class="background" alt="">
|
||||||
<div class="inOutDiv">
|
<div class="inOutDiv">
|
||||||
<h2>Authorizing application</h2>
|
<h2 class="w300">Authorizing application</h2>
|
||||||
<p id="statusBox">Please wait...</p>
|
<p id="statusBox">Please wait...</p>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
loadWasm("/static/wasm/authorize.wasm")
|
loadWasm("/static/wasm/authorize.wasm")
|
||||||
</script>
|
</script>
|
||||||
<div id="swipe" class="swipe"></div>
|
|
||||||
<div id="swipe-out" class="swipe-out"></div>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<script src="/static/js/wasm_exec.js"></script>
|
<script src="/static/js/wasm_exec.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<img src="/static/img/background.png" class="background" alt="">
|
||||||
<div class="inOutDiv">
|
<div class="inOutDiv">
|
||||||
<h2>Relaying back information, please wait...</h2>
|
<h2>Relaying back information, please wait...</h2>
|
||||||
<p id="statusBox">Processing information sent...</p>
|
<p id="statusBox">Processing information sent...</p>
|
||||||
|
@ -17,7 +18,5 @@
|
||||||
<script>
|
<script>
|
||||||
loadWasm("/static/wasm/clientKeyShare.wasm")
|
loadWasm("/static/wasm/clientKeyShare.wasm")
|
||||||
</script>
|
</script>
|
||||||
<div id="swipe" class="swipe"></div>
|
|
||||||
<div id="swipe-out" class="swipe-out"></div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<script src="/static/js/wasm_exec.js"></script>
|
<script src="/static/js/wasm_exec.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<img src="/static/img/background.png" class="background" alt="">
|
||||||
<div class="newOauth">
|
<div class="newOauth">
|
||||||
<h2>Dashboard</h2>
|
<h2>Dashboard</h2>
|
||||||
<p>Welcome to the {{ .identifier }} dashboard!</p>
|
<p>Welcome to the {{ .identifier }} dashboard!</p>
|
||||||
|
@ -49,7 +50,5 @@
|
||||||
<script>
|
<script>
|
||||||
loadWasm("/static/wasm/dashboard.wasm")
|
loadWasm("/static/wasm/dashboard.wasm")
|
||||||
</script>
|
</script>
|
||||||
<div id="swipe" class="swipe"></div>
|
|
||||||
<div id="swipe-out" class="swipe-out"></div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -13,8 +13,9 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<span id="passThrough" style="display: none;">{{ .identifier }}</span>
|
<span id="passThrough" style="display: none;">{{ .identifier }}</span>
|
||||||
|
<img src="/static/img/background.png" class="background" alt="">
|
||||||
<div class="inOutDiv">
|
<div class="inOutDiv">
|
||||||
<h2>Login</h2>
|
<h2 class="w300">Login</h2>
|
||||||
<p id="statusBox"></p>
|
<p id="statusBox"></p>
|
||||||
<div class="inputContainer" id="inputContainer">
|
<div class="inputContainer" id="inputContainer">
|
||||||
<div class="vAlign"><span id="inputNameBox"></span></div>
|
<div class="vAlign"><span id="inputNameBox"></span></div>
|
||||||
|
@ -32,6 +33,4 @@
|
||||||
<script>
|
<script>
|
||||||
loadWasm("/static/wasm/login.wasm")
|
loadWasm("/static/wasm/login.wasm")
|
||||||
</script>
|
</script>
|
||||||
<div id="swipe" class="swipe"></div>
|
|
||||||
<div id="swipe-out" class="swipe-out"></div>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -9,4 +9,7 @@
|
||||||
<link rel="icon" href="/static/svg/favicon.svg">
|
<link rel="icon" href="/static/svg/favicon.svg">
|
||||||
<script src="/static/js/logout.js"></script>
|
<script src="/static/js/logout.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Logging out...</p>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -14,7 +14,5 @@
|
||||||
<body>
|
<body>
|
||||||
<p>Please wait...</p>
|
<p>Please wait...</p>
|
||||||
<p>If your browser does not refresh, please refresh the page manually.</p>
|
<p>If your browser does not refresh, please refresh the page manually.</p>
|
||||||
<div id="swipe" class="swipe"></div>
|
|
||||||
<div id="swipe-out" class="swipe-out"></div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -11,8 +11,9 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<p style="display: none;" id="passthrough">{{ .unique_token }}</p>
|
<p style="display: none;" id="passthrough">{{ .unique_token }}</p>
|
||||||
<div class="inOutDiv"></div>
|
<img src="/static/img/background.png" class="background" alt="">
|
||||||
<h2>Signup</h2>
|
<div class="inOutDiv">
|
||||||
|
<h2 class="w300">Signup</h2>
|
||||||
<p>Signup to {{ .identifier }}!</p>
|
<p>Signup to {{ .identifier }}!</p>
|
||||||
<p id="statusBox"></p>
|
<p id="statusBox"></p>
|
||||||
<table id="inputContainer">
|
<table id="inputContainer">
|
||||||
|
@ -47,7 +48,5 @@
|
||||||
<script>
|
<script>
|
||||||
loadWasm("/static/wasm/signup.wasm")
|
loadWasm("/static/wasm/signup.wasm")
|
||||||
</script>
|
</script>
|
||||||
<div id="swipe" class="swipe"></div>
|
|
||||||
<div id="swipe-out" class="swipe-out"></div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -9,7 +9,8 @@
|
||||||
<link rel="stylesheet" type="text/css" href="/static/css/style.css"/>
|
<link rel="stylesheet" type="text/css" href="/static/css/style.css"/>
|
||||||
<script src="/static/js/wasm_exec.js"></script>
|
<script src="/static/js/wasm_exec.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body style="display: none;">
|
<body>
|
||||||
|
<img src="/static/img/background.png" class="background" alt="">
|
||||||
<div class="inOutDiv">
|
<div class="inOutDiv">
|
||||||
<h2>{{ .identifier }} Tester</h2>
|
<h2>{{ .identifier }} Tester</h2>
|
||||||
<p id="statusBox">Click authorize to begin the test</p>
|
<p id="statusBox">Click authorize to begin the test</p>
|
||||||
|
@ -19,7 +20,5 @@
|
||||||
<script>
|
<script>
|
||||||
loadWasm("/static/wasm/testApp.wasm")
|
loadWasm("/static/wasm/testApp.wasm")
|
||||||
</script>
|
</script>
|
||||||
<div id="swipe" class="swipe"></div>
|
|
||||||
<div id="swipe-out" class="swipe-out"></div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -9,11 +9,10 @@
|
||||||
<link rel="stylesheet" type="text/css" href="/static/css/style.css"/>
|
<link rel="stylesheet" type="text/css" href="/static/css/style.css"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<img src="/static/img/background.png" class="background" alt="">
|
||||||
<div class="inOutDiv">
|
<div class="inOutDiv">
|
||||||
<h2>{{ .identifier }} Tester</h2>
|
<h2>{{ .identifier }} Tester</h2>
|
||||||
<p>The tester has been disabled by the administrator.</p>
|
<p>The tester has been disabled by the administrator.</p>
|
||||||
</div>
|
</div>
|
||||||
<div id="swipe" class="swipe"></div>
|
|
||||||
<div id="swipe-out" class="swipe-out"></div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -8,10 +8,9 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall/js"
|
"syscall/js"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func authorize(deny bool, query url.Values, sleepTime time.Duration) {
|
func authorize(deny bool, query url.Values) {
|
||||||
// Get the token from local storage
|
// Get the token from local storage
|
||||||
localStorage := js.Global().Get("localStorage")
|
localStorage := js.Global().Get("localStorage")
|
||||||
token := localStorage.Call("getItem", "DONOTSHARE-secretKey").String()
|
token := localStorage.Call("getItem", "DONOTSHARE-secretKey").String()
|
||||||
|
@ -80,8 +79,6 @@ func authorize(deny bool, query url.Values, sleepTime time.Duration) {
|
||||||
denyUri += "&state=" + query.Get("state")
|
denyUri += "&state=" + query.Get("state")
|
||||||
}
|
}
|
||||||
|
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", denyUri)
|
js.Global().Get("window").Get("location").Call("replace", denyUri)
|
||||||
} else {
|
} else {
|
||||||
// Redirect to the redirect_uri with the code
|
// Redirect to the redirect_uri with the code
|
||||||
|
@ -90,8 +87,6 @@ func authorize(deny bool, query url.Values, sleepTime time.Duration) {
|
||||||
allowUri += "&state=" + query.Get("state")
|
allowUri += "&state=" + query.Get("state")
|
||||||
}
|
}
|
||||||
|
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", allowUri)
|
js.Global().Get("window").Get("location").Call("replace", allowUri)
|
||||||
}
|
}
|
||||||
} else if response.StatusCode == 401 {
|
} else if response.StatusCode == 401 {
|
||||||
|
@ -104,22 +99,9 @@ func authorize(deny bool, query url.Values, sleepTime time.Duration) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Transition in
|
|
||||||
js.Global().Get("document").Get("body").Set("style", "display: initial")
|
|
||||||
js.Global().Get("swipe-out").Get("classList").Call("add", "swipe-out-animate")
|
|
||||||
|
|
||||||
var sleepTime = 200 * time.Millisecond
|
|
||||||
if js.Global().Get("window").Call("matchMedia", "(prefers-reduced-motion: reduce)").Get("matches").Bool() {
|
|
||||||
sleepTime = 500 * time.Millisecond
|
|
||||||
}
|
|
||||||
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
|
|
||||||
// Redirect to log-in if not signed in
|
// Redirect to log-in if not signed in
|
||||||
localStorage := js.Global().Get("localStorage")
|
localStorage := js.Global().Get("localStorage")
|
||||||
if localStorage.Call("getItem", "DONOTSHARE-secretKey").IsNull() {
|
if localStorage.Call("getItem", "DONOTSHARE-secretKey").IsNull() {
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/login"+js.Global().Get("window").Get("location").Get("search").String())
|
js.Global().Get("window").Get("location").Call("replace", "/login"+js.Global().Get("window").Get("location").Get("search").String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,8 +151,6 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirect to log-out if not signed in
|
// Redirect to log-out if not signed in
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/logout"+js.Global().Get("window").Get("location").Get("search").String())
|
js.Global().Get("window").Get("location").Call("replace", "/logout"+js.Global().Get("window").Get("location").Get("search").String())
|
||||||
return
|
return
|
||||||
} else if response.StatusCode == 500 {
|
} else if response.StatusCode == 500 {
|
||||||
|
@ -207,18 +187,18 @@ func main() {
|
||||||
// Add an event listener to the Deny button
|
// Add an event listener to the Deny button
|
||||||
js.Global().Get("document").Call("getElementById", "denyButton").Call("addEventListener", "click", js.FuncOf(func(this js.Value, p []js.Value) interface{} {
|
js.Global().Get("document").Call("getElementById", "denyButton").Call("addEventListener", "click", js.FuncOf(func(this js.Value, p []js.Value) interface{} {
|
||||||
// We still partially authorize the user to prevent open redirects
|
// We still partially authorize the user to prevent open redirects
|
||||||
go authorize(true, query, sleepTime)
|
go authorize(true, query)
|
||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// Add an event listener to the Allow button
|
// Add an event listener to the Allow button
|
||||||
js.Global().Get("document").Call("getElementById", "allowButton").Call("addEventListener", "click", js.FuncOf(func(this js.Value, p []js.Value) interface{} {
|
js.Global().Get("document").Call("getElementById", "allowButton").Call("addEventListener", "click", js.FuncOf(func(this js.Value, p []js.Value) interface{} {
|
||||||
go authorize(false, query, sleepTime)
|
go authorize(false, query)
|
||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
// Auto-accept the request, as it's from an internal service
|
// Auto-accept the request, as it's from an internal service
|
||||||
go authorize(false, query, sleepTime)
|
go authorize(false, query)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for events
|
// Wait for events
|
||||||
|
|
|
@ -9,26 +9,12 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall/js"
|
"syscall/js"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Transition in
|
|
||||||
js.Global().Get("document").Get("body").Set("style", "display: initial")
|
|
||||||
js.Global().Get("swipe-out").Get("classList").Call("add", "swipe-out-animate")
|
|
||||||
|
|
||||||
var sleepTime = 200 * time.Millisecond
|
|
||||||
if js.Global().Get("window").Call("matchMedia", "(prefers-reduced-motion: reduce)").Get("matches").Bool() {
|
|
||||||
sleepTime = 500 * time.Millisecond
|
|
||||||
}
|
|
||||||
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
|
|
||||||
// Redirect to log-in if not signed in
|
// Redirect to log-in if not signed in
|
||||||
localStorage := js.Global().Get("localStorage")
|
localStorage := js.Global().Get("localStorage")
|
||||||
if localStorage.Call("getItem", "DONOTSHARE-secretKey").IsNull() {
|
if localStorage.Call("getItem", "DONOTSHARE-secretKey").IsNull() {
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/login"+js.Global().Get("window").Get("location").Get("search").String())
|
js.Global().Get("window").Get("location").Call("replace", "/login"+js.Global().Get("window").Get("location").Get("search").String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +86,5 @@ func main() {
|
||||||
|
|
||||||
// Redirect back to the referrer with the encrypted client key
|
// Redirect back to the referrer with the encrypted client key
|
||||||
redirectUri := strings.Split(js.Global().Get("document").Get("referrer").String(), "?")[0]
|
redirectUri := strings.Split(js.Global().Get("document").Get("referrer").String(), "?")[0]
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", redirectUri+"?ecdhPublicKey="+base64.URLEncoding.EncodeToString(privateKey.PublicKey().Bytes())+"&nonce="+base64.URLEncoding.EncodeToString(nonce)+"&cipherText="+base64.URLEncoding.EncodeToString(encryptedClientKey))
|
js.Global().Get("window").Get("location").Call("replace", redirectUri+"?ecdhPublicKey="+base64.URLEncoding.EncodeToString(privateKey.PublicKey().Bytes())+"&nonce="+base64.URLEncoding.EncodeToString(nonce)+"&cipherText="+base64.URLEncoding.EncodeToString(encryptedClientKey))
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,22 +191,9 @@ func fetchOauthClients(oauthList js.Value, localStorage js.Value, body []byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Transition in
|
|
||||||
js.Global().Get("document").Get("body").Set("style", "display: initial")
|
|
||||||
js.Global().Get("swipe-out").Get("classList").Call("add", "swipe-out-animate")
|
|
||||||
|
|
||||||
var sleepTime = 200 * time.Millisecond
|
|
||||||
if js.Global().Get("window").Call("matchMedia", "(prefers-reduced-motion: reduce)").Get("matches").Bool() {
|
|
||||||
sleepTime = 500 * time.Millisecond
|
|
||||||
}
|
|
||||||
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
|
|
||||||
// Redirect to log-in if not signed in
|
// Redirect to log-in if not signed in
|
||||||
localStorage := js.Global().Get("localStorage")
|
localStorage := js.Global().Get("localStorage")
|
||||||
if localStorage.Call("getItem", "DONOTSHARE-secretKey").IsNull() {
|
if localStorage.Call("getItem", "DONOTSHARE-secretKey").IsNull() {
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/login"+js.Global().Get("window").Get("location").Get("search").String())
|
js.Global().Get("window").Get("location").Call("replace", "/login"+js.Global().Get("window").Get("location").Get("search").String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,8 +248,6 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirect to log-out if not signed in
|
// Redirect to log-out if not signed in
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/logout")
|
js.Global().Get("window").Get("location").Call("replace", "/logout")
|
||||||
return
|
return
|
||||||
} else if response.StatusCode == 500 {
|
} else if response.StatusCode == 500 {
|
||||||
|
@ -414,8 +399,6 @@ func main() {
|
||||||
if response.StatusCode == 200 {
|
if response.StatusCode == 200 {
|
||||||
sessionElement.Call("remove")
|
sessionElement.Call("remove")
|
||||||
if session.(map[string]interface{})["session"].(string) == localStorage.Call("getItem", "DONOTSHARE-secretKey").String() {
|
if session.(map[string]interface{})["session"].(string) == localStorage.Call("getItem", "DONOTSHARE-secretKey").String() {
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/logout")
|
js.Global().Get("window").Get("location").Call("replace", "/logout")
|
||||||
}
|
}
|
||||||
} else if response.StatusCode != 500 {
|
} else if response.StatusCode != 500 {
|
||||||
|
@ -621,8 +604,6 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if response.StatusCode == 200 {
|
if response.StatusCode == 200 {
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/logout")
|
js.Global().Get("window").Get("location").Call("replace", "/logout")
|
||||||
} else if response.StatusCode != 500 {
|
} else if response.StatusCode != 500 {
|
||||||
js.Global().Call("alert", responseMap["error"].(string))
|
js.Global().Call("alert", responseMap["error"].(string))
|
||||||
|
@ -692,8 +673,6 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't care about the response, we're logging out anyway
|
// We don't care about the response, we're logging out anyway
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/logout")
|
js.Global().Get("window").Get("location").Call("replace", "/logout")
|
||||||
}()
|
}()
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -8,7 +8,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strings"
|
|
||||||
"syscall/js"
|
"syscall/js"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -69,34 +68,10 @@ func showInput(inputType int, inputContainer js.Value, usernameBox js.Value, sig
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Transition in
|
|
||||||
js.Global().Get("document").Get("body").Set("style", "display: initial")
|
|
||||||
js.Global().Get("swipe-out").Get("classList").Call("add", "swipe-out-animate")
|
|
||||||
|
|
||||||
var sleepTime = 200 * time.Millisecond
|
|
||||||
if js.Global().Get("window").Call("matchMedia", "(prefers-reduced-motion: reduce)").Get("matches").Bool() {
|
|
||||||
sleepTime = 500 * time.Millisecond
|
|
||||||
}
|
|
||||||
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
|
|
||||||
// Parse the url parameters using url.ParseQuery
|
|
||||||
dashboard := false
|
|
||||||
_, err := url.ParseQuery(strings.TrimPrefix(js.Global().Get("window").Get("location").Get("search").String(), "?"))
|
|
||||||
if err != nil {
|
|
||||||
dashboard = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// Redirect to app if already signed in
|
// Redirect to app if already signed in
|
||||||
localStorage := js.Global().Get("localStorage")
|
localStorage := js.Global().Get("localStorage")
|
||||||
if !localStorage.Call("getItem", "DONOTSHARE-secretKey").IsNull() {
|
if !localStorage.Call("getItem", "DONOTSHARE-secretKey").IsNull() {
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
if !dashboard {
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/authorize"+js.Global().Get("window").Get("location").Get("search").String())
|
js.Global().Get("window").Get("location").Call("replace", "/authorize"+js.Global().Get("window").Get("location").Get("search").String())
|
||||||
} else {
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/dashboard")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var usernameBox = js.Global().Get("document").Call("getElementById", "usernameBox")
|
var usernameBox = js.Global().Get("document").Call("getElementById", "usernameBox")
|
||||||
|
@ -244,13 +219,7 @@ func main() {
|
||||||
// Redirect to app
|
// Redirect to app
|
||||||
statusBox.Set("innerText", "Welcome!")
|
statusBox.Set("innerText", "Welcome!")
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
if !dashboard {
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/authorize"+js.Global().Get("window").Get("location").Get("search").String())
|
js.Global().Get("window").Get("location").Call("replace", "/authorize"+js.Global().Get("window").Get("location").Get("search").String())
|
||||||
} else {
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/dashboard")
|
|
||||||
}
|
|
||||||
} else if response.StatusCode == 401 {
|
} else if response.StatusCode == 401 {
|
||||||
// Login failed
|
// Login failed
|
||||||
showInput(1, inputContainer, usernameBox, signupButton, passwordBox, backButton, inputNameBox, statusBox, nextButton)
|
showInput(1, inputContainer, usernameBox, signupButton, passwordBox, backButton, inputNameBox, statusBox, nextButton)
|
||||||
|
@ -283,8 +252,6 @@ func main() {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
signupButton.Call("addEventListener", "click", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
signupButton.Call("addEventListener", "click", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/signup"+js.Global().Get("window").Get("location").Get("search").String())
|
js.Global().Get("window").Get("location").Call("replace", "/signup"+js.Global().Get("window").Get("location").Get("search").String())
|
||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
|
|
|
@ -9,7 +9,6 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
@ -58,34 +57,10 @@ func pow(resource string) (string, string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Transition in
|
|
||||||
js.Global().Get("document").Get("body").Set("style", "display: initial")
|
|
||||||
js.Global().Get("swipe-out").Get("classList").Call("add", "swipe-out-animate")
|
|
||||||
|
|
||||||
var sleepTime = 200 * time.Millisecond
|
|
||||||
if js.Global().Get("window").Call("matchMedia", "(prefers-reduced-motion: reduce)").Get("matches").Bool() {
|
|
||||||
sleepTime = 500 * time.Millisecond
|
|
||||||
}
|
|
||||||
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
|
|
||||||
// Parse the url parameters using url.ParseQuery
|
|
||||||
dashboard := false
|
|
||||||
_, err := url.ParseQuery(strings.TrimPrefix(js.Global().Get("window").Get("location").Get("search").String(), "?"))
|
|
||||||
if err != nil {
|
|
||||||
dashboard = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// Redirect to app if already signed in
|
// Redirect to app if already signed in
|
||||||
localStorage := js.Global().Get("localStorage")
|
localStorage := js.Global().Get("localStorage")
|
||||||
if !localStorage.Call("getItem", "DONOTSHARE-secretKey").IsNull() {
|
if !localStorage.Call("getItem", "DONOTSHARE-secretKey").IsNull() {
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
if !dashboard {
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/authorize"+js.Global().Get("window").Get("location").Get("search").String())
|
js.Global().Get("window").Get("location").Call("replace", "/authorize"+js.Global().Get("window").Get("location").Get("search").String())
|
||||||
} else {
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/dashboard")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var usernameBox = js.Global().Get("document").Call("getElementById", "usernameBox")
|
var usernameBox = js.Global().Get("document").Call("getElementById", "usernameBox")
|
||||||
|
@ -204,13 +179,7 @@ func main() {
|
||||||
// Redirect to app
|
// Redirect to app
|
||||||
statusBox.Set("innerText", "Welcome!")
|
statusBox.Set("innerText", "Welcome!")
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
if !dashboard {
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/authorize"+js.Global().Get("window").Get("location").Get("search").String())
|
js.Global().Get("window").Get("location").Call("replace", "/authorize"+js.Global().Get("window").Get("location").Get("search").String())
|
||||||
} else {
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/dashboard")
|
|
||||||
}
|
|
||||||
} else if response.StatusCode == 409 {
|
} else if response.StatusCode == 409 {
|
||||||
// Username taken
|
// Username taken
|
||||||
showElements(true, inputContainer, signupButton, loginButton)
|
showElements(true, inputContainer, signupButton, loginButton)
|
||||||
|
@ -230,8 +199,6 @@ func main() {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
loginButton.Call("addEventListener", "click", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
loginButton.Call("addEventListener", "click", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/login"+js.Global().Get("window").Get("location").Get("search").String())
|
js.Global().Get("window").Get("location").Call("replace", "/login"+js.Global().Get("window").Get("location").Get("search").String())
|
||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
|
|
|
@ -17,7 +17,6 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall/js"
|
"syscall/js"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func sha256Base64(s string) string {
|
func sha256Base64(s string) string {
|
||||||
|
@ -47,22 +46,9 @@ func randomChars(length int) (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Transition in
|
|
||||||
js.Global().Get("document").Get("body").Set("style", "display: initial")
|
|
||||||
js.Global().Get("swipe-out").Get("classList").Call("add", "swipe-out-animate")
|
|
||||||
|
|
||||||
var sleepTime = 200 * time.Millisecond
|
|
||||||
if js.Global().Get("window").Call("matchMedia", "(prefers-reduced-motion: reduce)").Get("matches").Bool() {
|
|
||||||
sleepTime = 500 * time.Millisecond
|
|
||||||
}
|
|
||||||
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
|
|
||||||
// Redirect to log-in if not signed in
|
// Redirect to log-in if not signed in
|
||||||
localStorage := js.Global().Get("localStorage")
|
localStorage := js.Global().Get("localStorage")
|
||||||
if localStorage.Call("getItem", "DONOTSHARE-secretKey").IsNull() {
|
if localStorage.Call("getItem", "DONOTSHARE-secretKey").IsNull() {
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/login"+js.Global().Get("window").Get("location").Get("search").String())
|
js.Global().Get("window").Get("location").Call("replace", "/login"+js.Global().Get("window").Get("location").Get("search").String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,8 +88,6 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirect to log-out if not signed in
|
// Redirect to log-out if not signed in
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/logout"+js.Global().Get("window").Get("location").Get("search").String())
|
js.Global().Get("window").Get("location").Call("replace", "/logout"+js.Global().Get("window").Get("location").Get("search").String())
|
||||||
return
|
return
|
||||||
} else if response.StatusCode == 500 {
|
} else if response.StatusCode == 500 {
|
||||||
|
@ -233,8 +217,6 @@ func main() {
|
||||||
localStorage.Call("setItem", "TESTER-privateKey", base64.StdEncoding.EncodeToString(privateKey.Bytes()))
|
localStorage.Call("setItem", "TESTER-privateKey", base64.StdEncoding.EncodeToString(privateKey.Bytes()))
|
||||||
|
|
||||||
// Redirect to the client key exchange endpoint
|
// Redirect to the client key exchange endpoint
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/clientKeyShare?ecdhPublicKey="+base64.URLEncoding.EncodeToString(privateKey.PublicKey().Bytes())+"&accessToken="+responseMap["access_token"].(string))
|
js.Global().Get("window").Get("location").Call("replace", "/clientKeyShare?ecdhPublicKey="+base64.URLEncoding.EncodeToString(privateKey.PublicKey().Bytes())+"&accessToken="+responseMap["access_token"].(string))
|
||||||
return
|
return
|
||||||
} else if response.StatusCode != 500 {
|
} else if response.StatusCode != 500 {
|
||||||
|
@ -335,8 +317,6 @@ func main() {
|
||||||
localStorage.Call("setItem", "TESTER-verifier", verifier)
|
localStorage.Call("setItem", "TESTER-verifier", verifier)
|
||||||
|
|
||||||
// Redirect to the authorization page
|
// Redirect to the authorization page
|
||||||
js.Global().Get("swipe").Get("classList").Call("add", "swipe-animate")
|
|
||||||
time.Sleep(sleepTime)
|
|
||||||
js.Global().Get("window").Get("location").Call("replace", "/authorize?response_type=code&client_id=TestApp-DoNotUse&redirect_uri="+url.QueryEscape(js.Global().Get("window").Get("location").Get("origin").String()+"/testApp")+"&code_challenge="+verifierChallenge+"&code_challenge_method=S256")
|
js.Global().Get("window").Get("location").Call("replace", "/authorize?response_type=code&client_id=TestApp-DoNotUse&redirect_uri="+url.QueryEscape(js.Global().Get("window").Get("location").Get("origin").String()+"/testApp")+"&code_challenge="+verifierChallenge+"&code_challenge_method=S256")
|
||||||
}()
|
}()
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Add table
Reference in a new issue