Passwordless login
Send and verify passwordless login codes
Use the passwordless client 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.
SendPasswordlessEmail
Section titled “SendPasswordlessEmail”#asyncSendPasswordlessEmail
SendPasswordlessEmail sends a passwordless authentication email
paramctxcontext.Context
Request context
paramemailstring
Email address.
paramoptionsSendPasswordlessOptions
Optional request settings.
returnsSendPasswordlessResponse
Send passwordless.
template := scalekit.TemplateTypeSigninresp, err := scalekitClient.Passwordless().SendPasswordlessEmail(ctx, "user@example.com", &scalekit.SendPasswordlessOptions{ Template: &template, MagiclinkAuthUri: "https://myapp.com/auth/callback", State: "state", ExpiresIn: 1800, TemplateVariables: map[string]string{ "app_name": "My App", },})if err != nil { // handle}_ = resp.AuthRequestIdVerifyPasswordlessEmail
Section titled “VerifyPasswordlessEmail”#asyncVerifyPasswordlessEmail
VerifyPasswordlessEmail verifies a passwordless authentication
paramctxcontext.Context
Request context
paramoptionsVerifyPasswordlessOptions
Optional request settings.
returnsVerifyPasswordLessResponse
Verified claims or result.
verified, err := scalekitClient.Passwordless().VerifyPasswordlessEmail(ctx, &scalekit.VerifyPasswordlessOptions{ Code: "123456", AuthRequestId: "auth_req_123",})if err != nil { // handle}_ = verifiedResendPasswordlessEmail
Section titled “ResendPasswordlessEmail”#asyncResendPasswordlessEmail
ResendPasswordlessEmail resends a passwordless authentication email
paramctxcontext.Context
Request context
paramauthRequestIdstring
Auth request id.
returnsSendPasswordlessResponse
Send passwordless.
resp, err := scalekitClient.Passwordless().ResendPasswordlessEmail(ctx, "auth_req_123")if err != nil { // handle}_ = resp.AuthRequestId