Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

144
Visualizações
Store link in localstorage before Laravel auth middleware redirect

I'm creating an invitation link for a laravel application, once a user clicks on the link or tries to access the link I want a path of the link to be stored in localStorage. This is what the link looks like https://example.com/{task_id}/{random_task_link}, I want the random_task_link to be stored in the localStorage. I have a code to do it using js but that is not the case. I used the code below to ensure that the user is logged in before they can access the link page

public function __construct(){
  $this->middleware('auth');
}

Now the localStorage code won't work because the page gets redirected before it is accessed. The main purpose of storing the link in the localStorage is to make sure that when a user clicks on the registration link the random_task_link is still available for future use.

Is there any way to get the link in the localStorage before the redirect takes place? Please help me I'm new to laravel. Thanks

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

i dont get your points there are lots of ways and points where you can store the data in localStorage first when you are creating the url save at the same time in the localStorage second make another middleware and call it before the auth middleware or apply just on some specific route third take this auth middleware to route level and even if grouped you can use Route::post('login', 'LoginController@login')->**withoutMiddleware**(['auth']); for this function and do whatever you wants to do

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda