Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

173
Vistas
How do i pass in a header from axios before a accessing a controller

is there a way to inject axios.get() header into a route request before the controller is accessed.

Please not that a link with the url (/verify) was sent to the users email via api and i want to include the bearer token then the user clicks the url.

This is my route from web.php

    Route::get('/verify-email', [VerifyEmailController::class, '__invoke'])
    ->middleware(['signed', 'throttle:6,1'])
    ->name('verification.verify');

And this is create in a js folder

import axios from 'axios'

axios.create({
  baseURL: '/verify-email',
  headers: {'Bearer Token': 'foobar515615612655'}
});

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You should add the x-requested-with header with XMLHttpRequest as value.

Checkout the following example:

headers: {
  'Bearer Token': 'foobar515615612655',
  'x-requested-with' : 'XMLHttpRequest'
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda