Skip to content

Commit

Permalink
Update redirect route after access token save (#24)
Browse files Browse the repository at this point in the history
* Update redirect route after access token save

* Update README to reflect the updated behaviour
  • Loading branch information
TVke authored Jan 30, 2023
1 parent f3f7e46 commit b9fda59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Route::get('your-redirect-uri', [SaveAccessTokenController::class, '__invoke']);

### Configure controller
The `SaveAccessTokenController` will store the initial access token and make follow-up request for the refresh token.
Afterwards you will be redirected to your `home` route.
Afterwards you will be redirected to `RouteServiceProvider::HOME`.
If you would like to alter the redirect you may extend this controller.


Expand Down
3 changes: 2 additions & 1 deletion src/Http/Controllers/SaveAccessTokenController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
namespace TimothyDC\LightspeedRetailApi\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\Request;
use TimothyDC\LightspeedRetailApi\Facades\LightspeedRetailApi;

Expand All @@ -26,6 +27,6 @@ protected function redirectPath(): string

return property_exists($this, 'redirectTo')
? $this->redirectTo
: route('home');
: RouteServiceProvider::HOME;
}
}

0 comments on commit b9fda59

Please sign in to comment.