Show currently logged in user

Closes: #329
This commit is contained in:
Eike Kettner
2020-11-26 23:53:31 +01:00
parent c87163052b
commit 7cc290135a
5 changed files with 106 additions and 27 deletions

View File

@ -1,6 +1,7 @@
module Data.Flags exposing
( Config
, Flags
, accountString
, getToken
, withAccount
, withoutAccount
@ -42,3 +43,12 @@ withAccount flags acc =
withoutAccount : Flags -> Flags
withoutAccount flags =
{ flags | account = Nothing }
accountString : AuthResult -> String
accountString auth =
if auth.collective == auth.user then
auth.collective
else
auth.collective ++ "/" ++ auth.user