calebporzio/onboard

Unable to redirect back to a step, getting ERR_TOO_MANY_REDIRECTS

git-bhanu opened this issue · 1 comments

My setup looks like following.

AppServiceProvider.php

OnboardFacade::addStep('Connect Slack App')
    ->link('/connect-slack')
    ->cta('Complete')
    ->completeIf(function (User $user) {
        return $user->hasTaskCreator('slack');
    });

Added middleware in my krenel.php under web

...
\App\Http\Middleware\RedirectToUnfinishedOnboardingStep::class,
...

When logged in I am redirected to proper link /connect-slack.

But it's a 404 because there is no route as /connect-slack. When I add a route in my web.php and try to visit the page I get too many redirects.

This is how I connect view to the route.

Route::get('/connect-slack', function () {
    return view('onboarding.slack-connect');
})->name('connect-slack');

How can I add the view to the route?

Route::view('/connect-slack', 'onboarding.slack-connect')
->withoutMiddleware(RedirectToUnfinishedOnboardingStep::class)
->name('connect-slack');