diff --git a/frontend/src/Mi.elm b/frontend/src/Mi.elm index 917935e..3cc26a6 100644 --- a/frontend/src/Mi.elm +++ b/frontend/src/Mi.elm @@ -1,12 +1,15 @@ -module Mi exposing (TokenData, errorToString, expectJson, request, tokenDecoder) +module Mi exposing (TokenData, errorToString, expectJson, request, tokenDecoder, tokenIntrospectURL) import Http exposing (Error(..)) import Json.Decode as D +import Url.Builder as UB type alias TokenData = { sub : String - , jti : String, aud: String, iss: String + , jti : String + , aud : String + , iss : String } @@ -19,6 +22,13 @@ tokenDecoder = (D.field "iss" D.string) +tokenIntrospectURL : String +tokenIntrospectURL = + UB.absolute + [ "api", "token", "info" ] + [] + + request method token path body expect = Http.request { method = method @@ -75,4 +85,4 @@ errorToString err = "Unexpected response from api: " ++ text BadUrl url -> - "Malformed url: " ++ url \ No newline at end of file + "Malformed url: " ++ url