Passwordless login
Send and verify passwordless login codes
Use scalekit_client.passwordless to send and verify email magic links or one-time codes for sign-in.
Call send, then verify with the code or link token from the user’s email to complete login.
send_passwordless_email
Section titled “send_passwordless_email”#asyncsend_passwordless_email
Runs send_passwordless_email and returns the result.
paramemailstr
Email address.
paramtemplateOptional[Union[str, 'TemplateType']]
Template.
parammagiclink_auth_uriOptional[str]
Magiclink auth uri.
paramstateOptional[str]
Opaque state string.
paramexpires_inOptional[int]
Expires in.
paramtemplate_variablesOptional[Dict[str, str]]
Template variables.
returnsSendPasswordlessResponse
Send passwordless.
response = scalekit_client.passwordless.send_passwordless_email( 'user@example.com', template='SIGNIN', state='random-state', expires_in=3600)
print(f'Auth Request ID: {response[0].auth_request_id}')verify_passwordless_email
Section titled “verify_passwordless_email”#asyncverify_passwordless_email
Method to verify passwordless authentication
paramcodeOptional[str]
Optional. The OTP code received via email
paramlink_tokenOptional[str]
Optional. The token from the magic link URL
paramauth_request_idOptional[str]
Optional. The authentication request ID from send request
returnsVerifyPasswordLessResponse
Verify Passwordless Response
response = scalekit_client.passwordless.verify_passwordless_email( code='123456', auth_request_id='auth_request_id')
print(f'Email: {response[0].email}')resend_passwordless_email
Section titled “resend_passwordless_email”#asyncresend_passwordless_email
Method to resend passwordless authentication email
paramauth_request_idstr
The authentication request ID from original send request
returnsSendPasswordlessResponse
Send Passwordless Response
response = scalekit_client.passwordless.resend_passwordless_email('auth_request_id')