1.1.7 • Published 12 months ago
Last release12 months ago
VueAuth is based on Vue 3 with composition style codes
Getting started
Lets install vue-auth with npm
npm install --save @musasutisna/vue-axios @musasutisna/vue-auth
Configuration
window.config.VUE_AUTH = {
API_BASEURL: 'your api baseurl',
API_LOGIN: '/login',
API_RECOVERY: '/recovery',
API_LOGOUT: '/u/logout',
API_VERIFY: '/u/profile',
TOKEN: 'your auth token',
LANG: {
LOGIN_PROCESS: 'loading message of login process',
RECOVERY_PROCESS: 'loading message of recovery process',
VERIFY_PROCESS: 'loading message of verify process',
LOGOUT_PROCESS: 'loading message of logout process'
}
}
Stores
| Property | Type | Description |
|---|
| result | Object | Result response from request login or verify on executed |
| Method | Type | Description |
|---|
| toLogin | async | Send request login. |
| toRecovery | async | Send request recovery. |
| toVerify | async | Send request auth verify. |
| toLogout | async | Send request auth logout. |
Components
- VueAuth, verify user authorization on token is exists.
| Props | Type | Description |
|---|
| class | String | Class value attributes will be bind into element. |
| Emit | Type | Description |
|---|
| verified | function | Executed when verified process is completed |
- VueProtect, verify user authorization.
| Props | Type | Description |
|---|
| class | String | Class value attributes will be bind into element. |
| Emit | Type | Description |
|---|
| verified | function | Executed when verified process is completed |