Auth
An Appstitch library for passwordless authentication
Last updated
Was this helpful?
An Appstitch library for passwordless authentication
Last updated
Was this helpful?
npm i @appstitch/auth
appstitch_auth: 1.0.0
Install Peer Dependencies
npm install @appstitch/core
appstitch_core: ^2.0.0
Remember to initialize
auth.signUp({email : "test@example.com"})
.then(result => {
if(result.success)
{
// A code has been successfully sent to the email address
// Ready to Confirm User (See below)
}
})
final opts = AuthOptions(email: "test@example.com");
final result = await auth.signUp(opts);
if(result.success!)
{
// A code has been successfully sent to the email address
// Ready to Confirm User (See below)
}
else
{
// handle error
}
auth.signIn({email : "test@example.com"})
.then(result => {
if(result.success)
{
// A code has been successfully sent to the email address
// Ready to Confirm User (See below)
}
})
final opts = AuthOptions(email: "test@example.com");
final result = await auth.signUp(opts);
if(result.success!)
{
// A code has been successfully sent to the email address
// Ready to Confirm User (See below)
}
else
{
// handle error
}
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
}
})
final opts = AuthOptions(code: "ABC123");
final result = await auth.signUp(opts);
if(result.success!)
{
// User ID that can be stored in your database
const id = result.id!;
// Token that can be used with other Appstitch Integrations
const authToken = result.authToken!;
}
else
{
// handle error
}