Auth
An Appstitch library for passwordless authentication
Install
npm i @appstitch/auth
Install Peer Dependencies
npm install @appstitch/core
Usage
Sign Up
auth.signUp({email : "[email protected]"})
.then(result => {
if(result.success)
{
// A code has been successfully sent to the email address
// Ready to Confirm User (See below)
}
})
Sign In
auth.signIn({email : "[email protected]"})
.then(result => {
if(result.success)
{
// A code has been successfully sent to the email address
// Ready to Confirm User (See below)
}
})
Confirm User
auth.confirmUser({code : "ABC123")
.then(result => {
if(result.success)
{
// Token that can be used with other Appstitch Integrations
const authToken = result.authToken;
// User ID
const id = result.id
}
})
Last updated
Was this helpful?