Accessing User and Location Context with the useAuth Hook
Authors:
Cameron Johns, Cille Schliebitz, Anita Gu
Changed on:
3 Feb 2025
Overview
This lesson explores the
`useAuth`
Key points
- Hook Purpose: The useAuth hook provides a convenient way to access details about the authenticated user, including their roles, permissions, and current context.
`useAuth`
- Contextual Information: The hook provides access to the user's current location or retailer context, which is vital for location-based applications.
- Location Coordinates: For location-context apps, useAuth allows retrieval of the selected store's coordinates (longitude and latitude), enabling map integration and location-based functionality.
- Fluent Store Application: In the context of Fluent Store, this hook will be used to get the coordinates of the currently viewed store, providing the data needed to display the store's location on the map.
In this lesson, you will use the
`useAuth`
In location-context web apps (like Fluent Store), you can use this hook to retrieve information about the currently logged in store location, including longitude and latitude coordinates which will be useful for our map.
Using Hooks
This video explains how to use a hook with the OMX UX Framework