Function: useAuth()
useAuth(
options):UseAuthReturn
Defined in: composables/react/useAuth.ts:207
useAuth — login, registration, and forgot-password flows.
Parameters
options
see UseAuthOptions.
Returns
loading/error state plus async auth actions — see UseAuthReturn.
Remarks
GraphQL integration: services are built per-call via createServices(graphqlClient).
login calls services.login.login() (LoginService) then services.user.getViewer()
(UserService) to fetch the Contact/Customer; the JWT is set as an in-memory Bearer
header via graphqlClient.updateConfig() only — never persisted (cross-reload auth
relies on an httpOnly cookie). registerContact runs company.createCompany →
user.registerContact → implicit login → address.createCompanyAddress →
user.triggerContactSendWelcomeEmailEvent. registerCustomer runs
user.registerCustomer → login → address.createCustomerAddress →
user.triggerCustomerSendWelcomeEmailEvent, re-fetching the viewer afterward.
When autoLogin is false the session is dropped via clearAccessToken().
forgotPassword calls user.sendPasswordResetEmail().