1.0.2 • Published 11 months ago

@musasutisna/vue-auth v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 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-auth

Configuration

window.config = {
  AUTH_API_BASEURL: 'your api baseurl',
  AUTH_API_LOGIN: '/login',
  AUTH_API_RECOVERY: '/recovery',
  AUTH_API_LOGOUT: '/u/logout',
  AUTH_API_VERIFY: '/u/profile',
  AUTH_TOKEN: 'your auth token',
  AUTH_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

  • useAuthAPI, axios configured of auth with configured baseUrl and header authorization with Bearer

  • useAuthStore,

PropertyTypeDescription
resultObjectResult 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.
PropsTypeDescription
classStringClass value attributes will be bind into element.
EmitTypeDescription
verifiedfunctionExecuted when verified process is completed
  • VueProtect, verify user authorization.
PropsTypeDescription
classStringClass value attributes will be bind into element.
EmitTypeDescription
verifiedfunctionExecuted when verified process is completed
1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago