@mvault/auth
v1.3.36
Published
MVault auth module
Readme
Mvault Authentication
Mvault Authentication is a system that facilitate developing secure services like login, updating password, resetting password... You'll find more details bellow.
API Reference
Login
auth.login({ username, password, provider, rememberMe })| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| username | string | Required.|
| password | string | Required.|
| provider | string | Optional.|
| rememberMe | string | Optional.|
Sign Up
auth.SignUp(displayName, email, phone, passwordConfirmation, password)| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| displayName | string | Required.|
| email | string | Required.|
| phone | int | Required.|
| password | string | Required.|
| passwordConfirmation | string | Required.|
Login By Provider
auth.LoginByProvider({ provider, token })| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| provider | string | Required.|
| token | string | Required.|
fetch a User
auth.fetchUser(scopes)| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| scopes | string | Required.|
Authenticated
auth.isAuthenticated()return true if the user is Authenticated otherwise false
Get Token
auth.getToken()Update User
auth.UpdateUser(token, Username, phone, email, customer)| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| token | string | Required.|
| username | string | Required.|
| phone | int | Required.|
| email | string | Required.|
| customer | string | Required.|
Update Password
auth.UpdatePassword(token, Currentpassword, Newpassword, Confirmpassword)| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| token | string | Required.|
| Currentpassword | string | Required.|
| Newpassword | string | Required.|
| Confirmpassword | string | Required.|
Reset Password
auth.ResetPassword(email, phone)| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| email | string | Required.|
| phone | int | Required.|
change Password
auth.changePassword(code, password, email, phone)| Parameter | Type | Description |
| :-------- | :------- | :------------------------- |
| code | int | Required.|
| password | string | Required.|
| email | string | Required.|
| phone | int | Required.|
