forrest icon indicating copy to clipboard operation
forrest copied to clipboard

Allow route name for callback uri

Open benrowe-chuffed opened this issue 1 year ago • 0 comments

Instead of providing a static callback URI in the config, it would be nice to calculate this value dynamically based on a route name:

So instead of:

'credentials' => [
        //Required:
        'callbackURI' => env('SALESFORCE_CALLBACK_URI'),
],

you could do this instead:

'credentials' => [
        //Required:
        'callbackRoute' => 'web.salesforce.callback',
],

Then in your routes you can register a route with this name.

Route::get(...)->name('web.salesforce.callback');

The advantage of this is being able to dynamically calculate the callback URI, instead of having to create new SALESFORCE_CALLBACK_URI values for every environment.

benrowe-chuffed avatar Nov 09 '23 05:11 benrowe-chuffed