on master help sign in
Added docs
commitac2022b0ebc48833537d9cd0791121ea0270741f authoriko <ilyakooo0@gmail.com> dateSat 11 May 2019, 17:06 (7 years ago) parentb10f442
1 file changed+6−2
denis/src/Server/Auth.hs+6−2
denis/src/Server/Auth.hs+6−2
@@ -84,6 +84,10 @@ type RegisterDescription = Description "Register the user for a new account.\n\n
8484
8585type 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."
8686
87+type ActivateDescription = Description "Activates a token using data from email"
88+
89+type DeactivateDescription = Description "Deactivates a token using data from email"
90+
8791-- MARK: Implementation
8892
8993type AuthenticationHandler =
@@ -102,11 +106,11 @@ type AuthenticationHandler =
102106 PostNoContent '[JSON, PlainText, FormUrlEncoded] (Headers '[Header "Set-Cookie" String] NoContent) :<|>
103107 "checkCookie" :> CheckCookieDescription :>
104108 Header "cookie" String :> GetNoContent '[JSON, PlainText, FormUrlEncoded] NoContent :<|>
105− "activate"
109+ "activate" :> ActivateDescription
106110 :> Header "cookie" String
107111 :> ReqBody '[JSON] TokenActivationData
108112 :> Post '[JSON] TokenActivationResult :<|>
109− "deactivate"
113+ "deactivate" :> DeactivateDescription
110114 :> ReqBody '[JSON] TokenActivationData
111115 :> PostNoContent '[JSON] NoContent
112116