> For the complete documentation index, see [llms.txt](https://docs.paytweed.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.paytweed.com/developer-tools/tweed-sdks/core-react/useauth.md).

# useAuth

### Connect Users

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.

<details>

<summary>connect ()</summary>

```tsx
import { useAuth } from "@paytweed/core-react";

const { connect } = useAuth()
```

**Returns**

This method returns a `Promise` that resolves with a string representing oAuth access token

</details>

### Logout users

To logout users from the application, call the logout function.

<details>

<summary>logout ()</summary>

```tsx
import { useAuth } from "@paytweed/core-react";

const { logout } = useAuth()
```

</details>

### Get user access token

Get the user access token ([JWT](https://jwt.io/))

<details>

<summary>accessToken</summary>

```tsx
import { useAuth } from "@paytweed/core-react";

const { accessToken } = useAuth()
```

**Returns**

This method returns a string represent the user [JWT](https://jwt.io/)

</details>

### Verify if the user is logged in

<details>

<summary>isAuthenticated</summary>

```tsx
import { useAuth } from "@paytweed/core-react";

const { isAuthenticated } = useAuth()
```

**Returns**

This method returns true if the user is authenticated and false if they are not.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.paytweed.com/developer-tools/tweed-sdks/core-react/useauth.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
