Advance Authentication
URI | METHOD |
---|---|
/api/forgot-password | POST |
/api/reset-password | POST |
/api/email/verification-notification | POST |
/api/confirm-password | POST |
Test with Postman
You can import the postman collection and import the postman environment
Just replace the {{base_url}}
variable for your app url, you can send requests with json data to test all endpoints.
Forgot Password
Field required:
{
"email": "john@doe.com"
}
- This endpoint does not require a token, because it is used if the user lost the password.
Define a link for reset password notification
In config/json-api-auth.php
you can set an endpoint:
'new_password_form_url' => env('FRONTEND_APP_URL', 'http://frontend.test') .'/new-password',
You can change it directly there or add a variable in .env
file FRONTEND_APP_URL
.
Email Verification
This request does not require any field only the token.
Define a redirect endpoint
In config/json-api-auth.php
you can set an endpoint:
'email_account_was_already_verified_url' => env('FRONTEND_APP_URL', 'http://frontend.test') . '/already-verified',
'email_account_just_verified_url' => env('FRONTEND_APP_URL', 'http://frontend.test') . '/verified',
Password Verification
Fields required for password verification:
{
"password": "YourPassword"
}
Customize the advance authentication process
You can customize the behavior of any endpoint in app/Http/
directory:
VALIDATION | CONTROLLER |
---|---|
Requests/JsonApiAuth/PasswordResetLinkRequest.php | Controllers/JsonApiAuth/PasswordResetLinkController.php |
Requests/JsonApiAuth/NewPasswordRequest.php | Controllers/JsonApiAuth/NewPasswordController.php |
no has request validation | Controllers/JsonApiAuth/EmailVerificationNotificationController.php |
no has request validation | Controllers/JsonApiAuth/ConfirmablePasswordController.php |