module OryKratos.Types.Registration ( RegistrationFlow (..), RegistrationFlowMethods (..), RegistrationFlowMethod (..), RegistrationFlowMethodConfig (..), RegistrationViaApiResponse (..), ) where import OryKratos.Types.Misc ( FormField, Identity, Message, Session, ) import Pre -- | data RegistrationFlow = RegistrationFlow { -- | and so on. active :: Maybe Text, -- | ExpiresAt is the time (UTC) when the flow expires. If the user still wishes to log in, a new flow has to be initiated. expires_at :: UTCTime, -- | id :: UUID, -- | IssuedAt is the time (UTC) when the flow occurred. issued_at :: UTCTime, -- | messages :: Maybe [Message], -- | Methods contains context for all enabled registration methods. If a registration flow has been processed, but for example the password is incorrect, this will contain error messages. methods :: RegistrationFlowMethods, -- | RequestURL is the initial URL that was requested from ORY Kratos. It can be used to forward information contained in the URL's path or query for example. request_url :: Text, -- | The flow type can either be `api` or `browser`. _type :: Maybe Text } deriving stock (Show, Eq, Generic, Data) instance FromJSON RegistrationFlow where parseJSON = genericParseJSON defaultOptions { constructorTagModifier = typeFieldRename, fieldLabelModifier = typeFieldRename } instance ToJSON RegistrationFlow where toEncoding = genericToEncoding defaultOptions { constructorTagModifier = typeFieldRename, fieldLabelModifier = typeFieldRename } -- | data RegistrationFlowMethods = RegistrationFlowMethods { -- | password :: Maybe RegistrationFlowMethod, -- | and so on. oidc :: Maybe RegistrationFlowMethod } deriving stock (Show, Eq, Generic, Data) instance FromJSON RegistrationFlowMethods instance ToJSON RegistrationFlowMethods where toEncoding = genericToEncoding defaultOptions -- | data RegistrationFlowMethod = RegistrationFlowMethod { -- | config :: RegistrationFlowMethodConfig, -- | and so on. method :: Text } deriving stock (Show, Eq, Generic, Data) instance FromJSON RegistrationFlowMethod instance ToJSON RegistrationFlowMethod where toEncoding = genericToEncoding defaultOptions -- | data RegistrationFlowMethodConfig = RegistrationFlowMethodConfig { -- | Action should be used as the form action URL `