diff options
| -rw-r--r-- | main.css | 9 | ||||
| -rw-r--r-- | src/Auth.js | 2 | ||||
| -rw-r--r-- | src/Main.purs | 6 | ||||
| -rw-r--r-- | templates/auth/index.html | 3 |
4 files changed, 17 insertions, 3 deletions
@@ -322,7 +322,7 @@ a.lcolonq-button-link :active { display: grid; width: 100%; height: 100%; - grid-template-rows: 1fr 1fr 1fr; + grid-template-rows: 1fr 1fr 1fr 1fr; grid-template-columns: 1fr 2fr 1fr; } @@ -341,3 +341,10 @@ a.lcolonq-button-link :active { #lcolonq-auth-submit { display: none; } + +#lcolonq-auth-error { + grid-row: 3; + grid-column: 2; + text-align: center; + color: red; +} diff --git a/src/Auth.js b/src/Auth.js index 246052c..3c077ce 100644 --- a/src/Auth.js +++ b/src/Auth.js @@ -50,6 +50,8 @@ export const _clearSessionCookie = () => { }; export const _getRedirect = (Just) => (Nothing) => (x) => () => { + const data = x["data"]; + if (!data) return Nothing; const r = x["data"]["redirect"]; if (r) return Just(r); return Nothing; diff --git a/src/Main.purs b/src/Main.purs index af89f35..7897b49 100644 --- a/src/Main.purs +++ b/src/Main.purs @@ -248,8 +248,10 @@ mainAuth = launchAff_ do } res <- resp getRedirect res >>= case _ of - Nothing -> liftEffect $ log "failed" - Just r -> liftEffect $ log $ "redirect: " <> r + Nothing -> do + err <- byId "lcolonq-auth-error" + removeClass "lcolonq-invisible" err + Just r -> UI.redirect r main :: Effect Unit main = case Config.mode of diff --git a/templates/auth/index.html b/templates/auth/index.html index 7b5cc03..a67d2fe 100644 --- a/templates/auth/index.html +++ b/templates/auth/index.html @@ -28,6 +28,9 @@ CONFIG_SUBST <input id="lcolonq-auth-submit" type="submit" value="log in now!!"> </form> </div> + <div id="lcolonq-auth-error"> + login failed. either you used the wrong credentials or something is messed up on my end :3 + </div> </div> </body> </html> |
