# authLoginOauth / oauthLoginHook

`authLoginOauth` finalizes an OAuth login after the user returns from the provider callback.

`oauthLoginHook` is a legacy alias that is still supported.

## Typical Flow

1. User clicks a button that navigates to `/oauth/{provider}`.
2. The provider authenticates the user.
3. BetterForms redirects back to your page with the slug `auth/oauth`.
4. That page runs `authLoginOauth`, usually in `onFormLoad`.
5. BetterForms stores the login token and continues through the normal login flow.

## Action Object

```json
{
  "action": "authLoginOauth"
}
```

## Notes

* This action is usually run automatically on the OAuth callback page.
* Use `authLoginOauth` as the preferred action name for new work.
* If the OAuth provider returns an error, BetterForms surfaces it through the normal error pipeline.
* This action does not need any custom options.

## Related Pages

* [OAuth](/reference/authentication/oauth.md)
* [Authentication](/reference/authentication.md)


---

# Agent Instructions: 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:

```
GET https://docs.klai.studio/reference/actions-processor/actions_overview/authloginoauth.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
