Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rsarvarov's avatar

Same auth driver on frontend (api && vue js) and backend (voyager)

Hey guys. I have website that have frontend based on API and server side admin panel (voyager). Currently it uses different auth drivers: jwt (https://github.com/tymondesigns/jwt-auth) for api, session for web. I want to automatically log in to the admin panel when logging in via jwt. Is it possible?

p.s. if i set jwt driver for "web" it throws "Auth driver [jwt] for guard [web] is not defined.". p.s. 2, I can't access to session from other drivers. For example I can't create middleware with

$user = auth()->guard('api')->user()

and attach it to web. It will return null and I don't know why.

0 likes
0 replies

Please or to participate in this conversation.