Commit 382de0ce authored by Vidhyut Pandya's avatar Vidhyut Pandya

- Fixed validation message not displaying issue in blog tag update API

- Fixed order by issue on page list API
- Removed refresh token route
- Allowed password reset API to the guest users, earlier it was not accessible by the guest users (the reset functionality should be accessible by guest user only)
parent 762901b9
......@@ -82,7 +82,7 @@ class BlogTagsController extends APIController
$validation = $this->validatingRequest($request, $blog_tag->id);
if ($validation->fails()) {
return $this->throwValidation($validation);
return $this->throwValidation($validation->messages()->first());
}
$this->repository->update($blog_tag, $request->all());
......
......@@ -31,7 +31,7 @@ class PagesController extends APIController
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : config('module.pages.table', 'pages').'created_at';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : config('module.pages.table', 'pages').'.created_at';
return PagesResource::collection(
$this->repository->getForDataTable()->orderBy($sortBy, $orderBy)->paginate($limit)
......
......@@ -22,6 +22,15 @@ class RedirectIfAuthenticated
return redirect('/');
}
if ($request->wantsJson() && auth()->guard('api')->user()) {
return response([
'error' => [
'message' => 'Not allowed',
'status_code' => 403,
],
], 403);
}
return $next($request);
}
}
......@@ -13,18 +13,16 @@
*/
Route::group(['namespace' => 'Api\V1', 'prefix' => 'v1', 'as' => 'v1.'], function () {
Route::group(['prefix' => 'auth'], function () {
Route::group(['prefix' => 'auth', 'middleware' => ['guest']], function () {
Route::post('register', 'RegisterController@register');
Route::post('login', 'AuthController@login');
// Password Reset
Route::post('password/email', 'ForgotPasswordController@sendResetLinkEmail');
});
Route::group(['middleware' => ['auth:api']], function () {
Route::group(['prefix' => 'auth'], function () {
Route::post('logout', 'AuthController@logout');
Route::post('refresh', 'AuthController@refresh');
// Password Reset Routes
Route::post('password/email', 'ForgotPasswordController@sendResetLinkEmail');
// Route::post('password/reset', 'ResetPasswordController@reset')->name('password.reset');
});
// Users
......@@ -36,7 +34,6 @@ Route::group(['namespace' => 'Api\V1', 'prefix' => 'v1', 'as' => 'v1.'], functio
// Roles
Route::resource('roles', 'RolesController', ['except' => ['create', 'edit']]);
Route::post('roles/delete-all', 'RolesController@deleteAll');
// Permission
Route::resource('permissions', 'PermissionController', ['except' => ['create', 'edit']]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment