Skip to main content

logout()

Log out a logged in user.

const { user, error } = await kontenbase.auth.logout()
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 remove the saved token in localStorage.

note
  • After logout, token set in the header will no longer be valid for authentication