Skip to main content

login()

Log in an existing user.

const { user, token, error } = await kontenbase.auth.login({
email: '[email protected]',
password: 'password',
})

Response

NameTypeDescription
res.userobjectResponse for data user
res.tokenstringResponse for data token
res.statusnumberResponse for status code
res.statusTextstringResponse for status message
res.errorobjectResponse for error occurred
info

Using this method in browser will also save the returned token in localStorage.

note
  • token returned is a Bearer Token Authentication that can be set in the header