pub struct MagicLinkFlow { /* private fields */ }Expand description
A sign-in in progress.
Implementations§
Source§impl MagicLinkFlow
impl MagicLinkFlow
Sourcepub fn new(config: Config) -> Result<MagicLinkFlow, Error>
pub fn new(config: Config) -> Result<MagicLinkFlow, Error>
A flow against the configured origin, sending no credentials: there are none yet.
Sourcepub fn from_builder(builder: ClientBuilder) -> Result<MagicLinkFlow, Error>
pub fn from_builder(builder: ClientBuilder) -> Result<MagicLinkFlow, Error>
A flow over a builder of the caller’s own — a custom HTTP client, hooks — whose credentials are replaced with none.
Sourcepub fn resume(
config: Config,
pending_token: impl Into<SensitiveString>,
) -> Result<MagicLinkFlow, Error>
pub fn resume( config: Config, pending_token: impl Into<SensitiveString>, ) -> Result<MagicLinkFlow, Error>
A flow that picks up where another left off, with the pending token that one
handed out through MagicLinkFlow::pending_token.
Sourcepub async fn create_session(
&self,
email_address: &str,
) -> Result<PendingAuthentication, Error>
pub async fn create_session( &self, email_address: &str, ) -> Result<PendingAuthentication, Error>
Asks Fizzy to email a sign-in code to the address, and keeps the pending token the
answer carries for MagicLinkFlow::redeem.
Sourcepub fn pending_token(&self) -> Option<SensitiveString>
pub fn pending_token(&self) -> Option<SensitiveString>
The token a pending sign-in is waiting on, for a caller that finishes the flow in another process.
Sourcepub async fn redeem(&self, code: &str) -> Result<SessionAuthorization, Error>
pub async fn redeem(&self, code: &str) -> Result<SessionAuthorization, Error>
Sends the code back with the pending token, and answers the session Fizzy signed
in. Without a pending token — no MagicLinkFlow::create_session before it, and
nothing given to MagicLinkFlow::resume — there is nothing to redeem against.