R
R
Rishat Sultanov2017-08-07 19:57:52
Laravel
Rishat Sultanov, 2017-08-07 19:57:52

How does redirect work with headers in Laravel 5.4?

Good evening.
There is this method:

Route::get('/voice-chat', function () {
        if (Auth::guest())
        {
            return view('home');
        }
        else
        {
            return redirect('http://localhost:8080/demos/multiparty.html')
            ->header('Authorization', 'Basic YWRtaW46c3VwZXJzZWNyZXQ=');
        }
});

On PostMan, this request works out with a bang, and Laravel receives 401. Not authorized.
My task is this. Send a redirect from Laravel (PHP) to Express (Node JS) where Laravel sends data with authorization, and the node receives it and gives access to the user.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2017-08-09
@Sanasol

And from what the hell should the header be transferred to the redirect?
That doesn't work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question