pub struct MagicLinkService<S> { /* private fields */ }Expand description
Magic link authentication service.
§Flow
- App calls
request_link(email)→ gets a raw token (send in email yourself). - User clicks link → app calls
verify(token, ip)→ session is created.
The magic link token is single-use and expires after ttl (default 15 min).
Implementations§
Source§impl<S> MagicLinkService<S>
impl<S> MagicLinkService<S>
pub fn new(storage: S, events: EventBus, session_ttl_secs: i64) -> Self
pub fn with_link_ttl(self, ttl: Duration) -> Self
Auto Trait Implementations§
impl<S> Freeze for MagicLinkService<S>where
S: Freeze,
impl<S> !RefUnwindSafe for MagicLinkService<S>
impl<S> Send for MagicLinkService<S>where
S: Send,
impl<S> Sync for MagicLinkService<S>where
S: Sync,
impl<S> Unpin for MagicLinkService<S>where
S: Unpin,
impl<S> UnsafeUnpin for MagicLinkService<S>where
S: UnsafeUnpin,
impl<S> !UnwindSafe for MagicLinkService<S>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more