on master help sign in
Added docs
ac2022biko
denis/src/Server/Auth.hs+6−2
@@ -84,6 +84,10 @@ type RegisterDescription = Description "Register the user for a new account.\n\n
84
84
85type CheckCookieDescription = Description "Checks if a parseable cookie is present in the request.\n\nDoes not check if the cookie itself contains valid credentials.\n\nReturns 204 NoContent if cookie is present.\n\nReturns 401 Unauthorized if the cookie is not present."
85type CheckCookieDescription = Description "Checks if a parseable cookie is present in the request.\n\nDoes not check if the cookie itself contains valid credentials.\n\nReturns 204 NoContent if cookie is present.\n\nReturns 401 Unauthorized if the cookie is not present."
86
86
87+type ActivateDescription = Description "Activates a token using data from email"
88+
89+type DeactivateDescription = Description "Deactivates a token using data from email"
90+
87-- MARK: Implementation
91-- MARK: Implementation
88
92
89type AuthenticationHandler =
93type AuthenticationHandler =
@@ -102,11 +106,11 @@ type AuthenticationHandler =
102 PostNoContent '[JSON, PlainText, FormUrlEncoded] (Headers '[Header "Set-Cookie" String] NoContent) :<|>
106 PostNoContent '[JSON, PlainText, FormUrlEncoded] (Headers '[Header "Set-Cookie" String] NoContent) :<|>
103 "checkCookie" :> CheckCookieDescription :>
107 "checkCookie" :> CheckCookieDescription :>
104 Header "cookie" String :> GetNoContent '[JSON, PlainText, FormUrlEncoded] NoContent :<|>
108 Header "cookie" String :> GetNoContent '[JSON, PlainText, FormUrlEncoded] NoContent :<|>
105− "activate"
109+ "activate" :> ActivateDescription
106 :> Header "cookie" String
110 :> Header "cookie" String
107 :> ReqBody '[JSON] TokenActivationData
111 :> ReqBody '[JSON] TokenActivationData
108 :> Post '[JSON] TokenActivationResult :<|>
112 :> Post '[JSON] TokenActivationResult :<|>
109− "deactivate"
113+ "deactivate" :> DeactivateDescription
110 :> ReqBody '[JSON] TokenActivationData
114 :> ReqBody '[JSON] TokenActivationData
111 :> PostNoContent '[JSON] NoContent
115 :> PostNoContent '[JSON] NoContent
112
116