# `LightningWeb.Hooks`
[🔗](https://github.com/OpenFn/lightning/blob/main/lib/lightning_web/hooks.ex#L1)

LiveView Hooks

# `on_mount`

Finds and assigns a project to the socket, if a user doesn't have access
they are redirected and shown a 'No Access' screen via a `:nav` flash message.

There is a fallthru function, when there is no `project_id` in the params -
this is for liveviews that may or may not have a `project_id` depending on
usage - like `DashboardLive`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
