signInWithMagicLink
const url = 'http://localhost:4000/api/auth/sign-in/magic-link';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"email":"example","name":"example","callbackURL":"example","newUserCallbackURL":"example","errorCallbackURL":"example","metadata":{"additionalProperty":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:4000/api/auth/sign-in/magic-link \ --header 'Content-Type: application/json' \ --data '{ "email": "example", "name": "example", "callbackURL": "example", "newUserCallbackURL": "example", "errorCallbackURL": "example", "metadata": { "additionalProperty": "example" } }'Sign in with magic link
Signs in an existing account only, never creates one. The link works once, for 5 minutes. No email is sent for an address with no account, and one address gets at most one link a minute, but the answer is the same. callbackURL, newUserCallbackURL and errorCallbackURL must be on BASE_URL or an ALLOWED_HOSTS name.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Email address to send the magic link
User display name. Only used if the user is registering for the first time. Eg: “my-name”
URL to redirect after magic link verification
URL to redirect after new user signup. Only used if the user is registering for the first time.
URL to redirect after error.
Additional metadata to pass to sendMagicLink.
object
Example generated
{ "email": "example", "name": "example", "callbackURL": "example", "newUserCallbackURL": "example", "errorCallbackURL": "example", "metadata": { "additionalProperty": "example" }}Responses
Section titled “Responses”Success
object
Example generated
{ "status": true}Bad Request. Usually due to missing parameters, or invalid parameters.
object
Example generated
{ "message": "example"}Unauthorized. Due to missing or invalid authentication.
object
Example generated
{ "message": "example"}Forbidden. You do not have permission to access this resource or to perform this action.
object
Example generated
{ "message": "example"}Not Found. The requested resource was not found.
object
Example generated
{ "message": "example"}Too Many Requests. You have exceeded the rate limit. Try again later.
object
Example generated
{ "message": "example"}Internal Server Error. This is a problem with the server that you cannot fix.
object
Example generated
{ "message": "example"}