diff --git a/api/src/Api/Auth.hs b/api/src/Api/Auth.hs index a8c461e..ec676fb 100644 --- a/api/src/Api/Auth.hs +++ b/api/src/Api/Auth.hs @@ -80,12 +80,16 @@ unprotected cs jwts = :<|> signupHandler data AuthAPI mode = AuthAPI - { login :: mode :- (Servant.Auth.Server.Auth '[JWT] User' :> Protected) - , me :: mode :- Unprotected + { + protectedApi :: mode + :- (Servant.Auth.Server.Auth '[JWT] User' + :> Protected) + , unprotectedApi :: mode + :- Unprotected } deriving stock Generic authHandler :: CookieSettings -> JWTSettings -> AuthAPI (AsServerT AppM) authHandler cs jwts = AuthAPI - { login = protected - , me = unprotected cs jwts + { protectedApi = protected + , unprotectedApi = unprotected cs jwts } \ No newline at end of file diff --git a/api/src/Db/User.hs b/api/src/Db/User.hs index 743e8b7..f4e4e39 100644 --- a/api/src/Db/User.hs +++ b/api/src/Db/User.hs @@ -19,7 +19,6 @@ import Data.Functor.Identity (Identity) import Data.Text (Text) import Data.Aeson (FromJSON, ToJSON) import Rel8 -import Rel8 (Insert(onConflict), each) import Password (HashedPassword (HashedPassword)) newtype UserId = UserId { toInt64 :: Int64 } diff --git a/api/todo b/api/todo new file mode 100644 index 0000000..77eb7b4 --- /dev/null +++ b/api/todo @@ -0,0 +1,4 @@ +- toPassword check security +- Separate User and UserDB +- Craft JWT ? +- Crud pipelines