Fix #43: Sanitize server url. (#47)

* Sanitize server url.
* Prettify auth page.
This commit is contained in:
Nicolas Perriault 2017-04-25 10:13:00 +02:00 committed by GitHub
parent b5fa55f49d
commit 5f457f009a
2 changed files with 22 additions and 2 deletions

View File

@ -160,9 +160,15 @@ registerApp { server, location } =
let
appUrl =
location.origin ++ location.pathname
cleanServer =
if String.endsWith "/" server then
String.dropRight 1 server
else
server
in
Mastodon.register
server
cleanServer
"tooty"
appUrl
"read write follow"

View File

@ -567,7 +567,21 @@ homepageView model =
authView : Model -> Html Msg
authView model =
div [ class "col-md-4 col-md-offset-4" ]
[ div [ class "panel panel-default" ]
[ div [ class "page-header" ]
[ h1 []
[ text "tooty"
, small []
[ text " is a Web client for the "
, a
[ href "https://github.com/tootsuite/mastodon"
, target "_blank"
]
[ text "Mastodon" ]
, text " API."
]
]
]
, div [ class "panel panel-default" ]
[ div [ class "panel-heading" ] [ text "Authenticate" ]
, div [ class "panel-body" ]
[ Html.form [ class "form", onSubmit Register ]