Adamite
  • Initial page
  • Server
    • Introduction
    • Database
      • Configuration
      • Using different adapters
        • Memory Adapter
      • Securing your data
        • Securing read operations
    • Functions
      • Invokable Functions
      • Runtime Functions
      • Scheduled Functions
  • SDK
    • Introduction
    • Database
      • Introduction
      • Read a document
      • Read multiple documents
      • Subscribe to changes
      • Create a new document
      • Update an existing document
      • Delete a document
    • Authentication
      • Create a user
      • Log in and log out
      • Get the logged in user
    • Functions
      • Invoke a function
Powered by GitBook
On this page

Was this helpful?

  1. SDK
  2. Authentication

Log in and log out

To sign in, use the loginWithEmailAndPassword method. If a login error occurs (such as invalid login credentials), it will be thrown as an exception.

try {
  await adamite()
    .auth()
    .loginWithEmailAndPassword("email@email.com", "password");
} catch (err) {
  console.error(err);
}

To sign out, you can use the logout method.

await adamite().auth().logout();
PreviousCreate a userNextGet the logged in user

Last updated 5 years ago

Was this helpful?