@enso-ui/auth
Version:
Authentication pages, auth store helpers, and password-strength utilities for Enso UI.
110 lines (72 loc) • 3.4 kB
Markdown
# Auth
[](https://github.com/enso-ui/auth/blob/main/LICENSE)
[](https://www.npmjs.com/package/@enso-ui/auth)
[](https://www.npmjs.com/package/@enso-ui/auth)
[](https://vuejs.org/)
[](https://developer.mozilla.org/docs/Web/JavaScript)
[](https://sass-lang.com/)
[](https://www.npmjs.com/package/@enso-ui/auth)
[](https://github.com/enso-ui/auth/issues)
[](https://github.com/enso-ui/auth/pulls)
## Description
Authentication pages, auth store helpers, and password-strength utilities for Enso UI.
## Installation
Install the package:
```bash
yarn add @enso-ui/auth
```
This package is also available through the full `enso-ui` workspace bundle.
## Features
- exports a lightweight `PasswordStrength` meter from the root package entry
- ships guest-only auth routes for login and password reset flows
- includes a Pinia auth store for login/logout state and intended-route handling
- registers the auth store bootstrap through `src/bulma/register.js`
## Usage
```js
import { PasswordStrength } from '@enso-ui/auth';
```
## API
### `PasswordStrength`
Lightweight password strength meter used by reset and registration forms.
Import: `@enso-ui/auth`
Props:
- `password: string`
### `auth()`
Pinia auth store.
Import: `@enso-ui/auth/src/pinia/auth.js`
Actions:
- `login()`
- `setIntendedRoute(value)`
- `setIntendedPath(value)`
- `logoutState()`
- `logout()`
### `register()`
Bootstrap helper that initializes the auth store in the Bulma shell.
Import: `@enso-ui/auth/src/bulma/register.js`
## Routes
### Guest auth pages
Route names:
- `login`
- `password.email`
- `password.reset`
Pages:
- `src/bulma/pages/auth/Login.vue`
- `src/bulma/pages/auth/password/EmailResetLink.vue`
- `src/bulma/pages/auth/password/Reset.vue`
The route module guards all three routes with a guest redirect. The package also ships the shared `Auth` layout and the reusable `AuthForm` building block.
## Backend Integration
The package expects the host Laravel application to expose the standard auth endpoints used by the form pages:
- `login`
- `password.email`
- `password.reset`
- `/api/logout`
## Depends On
- [`@enso-ui/directives`](https://docs.laravel-enso.com/frontend/directives.html) [↗](https://github.com/enso-ui/directives)
- [`@enso-ui/forms`](https://docs.laravel-enso.com/frontend/forms.html) [↗](https://github.com/enso-ui/forms)
- [`@enso-ui/laravel-validation`](https://docs.laravel-enso.com/frontend/laravel-validation.html) [↗](https://github.com/enso-ui/laravel-validation)
- [`@enso-ui/ui`](https://docs.laravel-enso.com/frontend/ui.html) [↗](https://github.com/enso-ui/ui)
## Contributions
are welcome. Pull requests are great, but issues are good too.
Thank you to all the people who already contributed to Enso!
## License
[MIT](https://github.com/enso-ui/auth/blob/main/LICENSE)