aboutsummaryrefslogtreecommitdiff
path: root/lib/Server.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Server.hs')
-rw-r--r--lib/Server.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Server.hs b/lib/Server.hs
index 6c293f0..5ece540 100644
--- a/lib/Server.hs
+++ b/lib/Server.hs
@@ -91,8 +91,9 @@ server gtfs@GTFS{..} dbpool = handleDebugAPI :<|> handleStations :<|> handleTime
Just res -> pure res
Nothing -> throwError err404
handleRegister tripID = do
+ -- TODO registration may carry extra information!
expires <- liftIO $ getCurrentTime <&> addUTCTime validityPeriod
- RunningTripKey token <- runSql dbpool $ insert (RunningTrip expires False tripID)
+ RunningTripKey token <- runSql dbpool $ insert (RunningTrip expires False tripID Nothing)
pure token
handleTripPing ping = do
checkTokenValid dbpool (coerce $ tripPingToken ping)