diff options
author | Ben Sima <ben@bsima.me> | 2023-01-09 13:06:53 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2023-01-09 13:06:53 -0500 |
commit | 906db8d4ac24f65f38e1d31bfdaa47602a54d759 (patch) | |
tree | 6f17a84703fb12599d393dc58a90ba9e62f5ca97 /Biz/Auth.hs | |
parent | 3e89ecfeb236065d845a632324324d57c49b829e (diff) |
Reorganize some Auth/App stuff
Diffstat (limited to 'Biz/Auth.hs')
-rw-r--r-- | Biz/Auth.hs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Biz/Auth.hs b/Biz/Auth.hs index 1c3e45c..14f67ec 100644 --- a/Biz/Auth.hs +++ b/Biz/Auth.hs @@ -18,6 +18,8 @@ module Biz.Auth -- * Servant Helpers SetCookies, + liveCookieSettings, + testCookieSettings, ) where @@ -38,6 +40,21 @@ notset = "notset" type SetCookies ret = (Headers '[Header "Set-Cookie" Auth.SetCookie, Header "Set-Cookie" Auth.SetCookie] ret) +liveCookieSettings :: Auth.CookieSettings +liveCookieSettings = + Auth.defaultCookieSettings + { Auth.cookieIsSecure = Auth.Secure, + -- disable XSRF protection because we don't use any javascript + Auth.cookieXsrfSetting = Nothing + } + +testCookieSettings :: Auth.CookieSettings +testCookieSettings = + Auth.defaultCookieSettings + { Auth.cookieIsSecure = Auth.NotSecure, + Auth.cookieXsrfSetting = Nothing + } + -- | These are arguments that a 3rd-party OAuth provider needs in order for us -- to authenticate a user. data OAuthArgs = OAuthArgs |