Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add route names to Passport::routes() #599

Closed
d8vjork opened this issue Jan 7, 2018 · 2 comments
Closed

[Feature Request] Add route names to Passport::routes() #599

d8vjork opened this issue Jan 7, 2018 · 2 comments

Comments

@d8vjork
Copy link
Contributor

d8vjork commented Jan 7, 2018

Hi all πŸ™‹β€β™‚οΈ

As title says, modifying passport/src/RouteRegistrar.php file:

$this->router->post('/token', [
        'uses' => 'AccessTokenController@issueToken',
	'as' => 'oauth.token',
        'middleware' => 'throttle',
]);
@nejtr0n
Copy link

nejtr0n commented Aug 6, 2018

Same issue. it would be greate to have names of route to use them in custom controllers like

        $request = Request::create('/oauth/token', 'POST', [
            'grant_type' => 'password',
            'client_id' => config('services.vue_client.id'),
            'client_secret' => config('services.vue_client.secret'),
            'username' => $request->email,
            'password' => $request->password,
        ]);

Proble is in

        $request = Request::create('/oauth/token', 'POST', [

This route could be prefixed with api/v1 for example,
and route names will help to avoid
hardcoding of it.

@driesvints
Copy link
Member

I'm not sure if it'll get merged but you can always try to send in a PR. I can see this being valuable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants