useAuth
Manage user authentication with functions such as connect, logout, and retrieve access token.
Last updated
Manage user authentication with functions such as connect, logout, and retrieve access token.
Use the connect() function to handle user sign-ups and sign-ins. When a user signs up, a wallet is created for them behind the scenes and becomes immediately available upon completion of the sign-up process. To modify the login options, simply visit the tweed.
import { useAuth } from "@paytweed/core-react";
const { connect } = useAuth()Returns
This method returns a Promise that resolves with a string representing oAuth access token
To logout users from the application, call the logout function.
Get the user access token (JWT)
import { useAuth } from "@paytweed/core-react";
const { accessToken } = useAuth()Returns
This method returns a string represent the user JWT
Last updated
import { useAuth } from "@paytweed/core-react";
const { isAuthenticated } = useAuth()