import { default } from "https://deno.land/x/gotrue@3.0.0/src/GoTrueClient.ts";
Constructors
Create a new client for use in the browser.
Properties
The session object for the currently logged in user or null.
The currently logged in user or null.
Namespace for the GoTrue API methods. These can be used for example to get a user from a JWT in a server environment or reset a user's password.
Methods
Recovers the session from LocalStorage and refreshes Note: this method is async to accommodate for AsyncStorage e.g. in React native.
Attempts to get the session from LocalStorage Note: this should never be async (even for React Native), as we need it to return immediately in the constructor.
set currentSession and currentUser process to _startAutoRefreshToken if possible
Clear and re-create refresh token timer
Gets the session data from a URL string
Receive a notification every time an auth event happens.
Force refreshes the session including the user data in case it was updated in a different session.
Overrides the JWT on the current client. The JWT will then be sent in all subsequent network requests.
Sets the session data from refresh_token and returns current Session and Error
Log in an existing user, or login via a third-party provider.
Inside a browser context, signOut()
will remove extract the logged in user from the browser session
and log them out - removing all items from localstorage and then trigger a "SIGNED_OUT" event.
For server-side management, you can disable sessions by passing a JWT through to auth.api.signOut(JWT: string)
Creates a new user.
Updates user data, if there is a logged in user.
Inside a browser context, user()
will return the user data, if there is a logged in user.
For server-side management, you can get a user through auth.api.getUserByCookie()