Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ TODO.md
result
.envrc
elm-stuff/
serve.sh
3 changes: 2 additions & 1 deletion assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import "../css/app.css";
import '@fortawesome/fontawesome-free/js/fontawesome';
import '@fortawesome/fontawesome-free/js/solid';
import '@fortawesome/fontawesome-free/js/brands';

import './jspdf.min.js';
import './svg2pdf.js';
Expand Down Expand Up @@ -32,7 +33,7 @@ import { Elm } from "../src/Main.elm";
const initElm = () => {
var app = Elm.Main.init({
flags: {
csrfToken: csrfToken,
csrfToken: csrfToken(),
}
});

Expand Down
6 changes: 3 additions & 3 deletions assets/package-lock.json

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

17 changes: 17 additions & 0 deletions assets/src/Api.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module Api exposing (getUser)

import Http
import Viewer exposing (Viewer)


getUser : (Result Http.Error Viewer -> msg) -> Cmd msg
getUser receivedViewer =
Http.request
{ method = "GET"
, headers = []
, url = "/api/user"
, body = Http.emptyBody
, expect = Http.expectJson receivedViewer Viewer.decoder
, timeout = Nothing
, tracker = Nothing
}
17 changes: 17 additions & 0 deletions assets/src/Auth.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module Auth exposing (logout)

import Http
import Session exposing (Session)


logout : Session -> (Result Http.Error () -> msg) -> Cmd msg
logout session receivedLogout =
Http.request
{ method = "DELETE"
, headers = [ Http.header "x-csrf-token" (Session.csrfToken session) ]
, url = "/auth/logout"
, body = Http.emptyBody
, expect = Http.expectWhatever receivedLogout
, timeout = Nothing
, tracker = Nothing
}
1 change: 0 additions & 1 deletion assets/src/Github.elm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ module Github exposing
-}

import Base64
import Browser.Navigation
import Http
import Json.Decode as Decode exposing (Decoder)
import Json.Decode.Pipeline as Decode
Expand Down
1 change: 0 additions & 1 deletion assets/src/LocalStorage.elm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import Length exposing (Meters)
import Pattern exposing (Pattern)
import Point2d exposing (Point2d)
import Storage.Address as Address exposing (Address)
import Url.Parser exposing ((</>), Parser, map, oneOf, s, string, top)


port storeCache : { key : String, value : String } -> Cmd msg
Expand Down
2 changes: 1 addition & 1 deletion assets/src/Login.elm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Main exposing (main)
module Login exposing (main)

import Browser
import Browser.Navigation
Expand Down
Loading