The easiest way for users to signup is using email and password. All user are stored in the users
table and relevant account information will be saved in the tables under the auth
schema.
Passwords are hashed using bcrypt with multiple salt rounds.
The easiest way to register and login users is with nhost-js-sdk.
npm install --save nhost-js-sdk
In ex /src/utils/nhost.js
:
import nhost from "nhost-js-sdk";
const config = {
base_url: "https://backend-REPLACE.nhost.app",
};
nhost.initializeApp(config);
const auth = nhost.auth();
const storage = nhost.storage();
export { auth, storage };
Register a user:
import { auth } from "utils/nhost";
const email = "elon@tesla.com";
const password = "123123";
auth.register(email, password);
Login user:
import { auth } from "utils/nhost";
const email = "elon@tesla.com";
const password = "123123";
auth.login(email, password);
Learn more about the nhost-js-sdk
.
Learn more about the Auth API Reference.
All users can be managed in the Nhost console in the Auth tab.