mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-24 06:54:03 +03:00
Add logout endpoint.
This commit is contained in:
parent
0501b4da4b
commit
146240c3dd
@ -24,6 +24,7 @@ routes getStaticRoutes htmlToString =
|
||||
, serverRequestInfo
|
||||
, repoStars
|
||||
, repoStars2
|
||||
, logout
|
||||
]
|
||||
|
||||
|
||||
@ -120,6 +121,21 @@ nonHybridRoute =
|
||||
)
|
||||
|
||||
|
||||
logout : ApiRoute ApiRoute.Response
|
||||
logout =
|
||||
ApiRoute.succeed
|
||||
(\isAvailable ->
|
||||
DataSource.succeed
|
||||
(ServerResponse.stringBody "You are logged out"
|
||||
|> ServerResponse.withHeader "Set-Cookie" "username=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT"
|
||||
)
|
||||
)
|
||||
|> ApiRoute.literal "api"
|
||||
|> ApiRoute.slash
|
||||
|> ApiRoute.literal "logout"
|
||||
|> ApiRoute.serverless
|
||||
|
||||
|
||||
repoStars : ApiRoute ApiRoute.Response
|
||||
repoStars =
|
||||
ApiRoute.succeed
|
||||
|
Loading…
Reference in New Issue
Block a user