D
D
Daneil2018-02-12 13:07:39
JSON Web Token
Daneil, 2018-02-12 13:07:39

How to properly process JWT in middleware and pass further information from the token to the controllers?

Laravel 5.3.
I wrote a middleware to check the token for presence and validity, but I don’t understand how to forward the information from the token further. And is this the correct approach? Tell me please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Barmunk, 2018-02-13
@Daneil

Log in to Middleware, get a token, write it to the session or $request (if you need constantly fresh data) and then use it anywhere.

A
Alexander Aksentiev, 2018-02-12
@Sanasol

https://github.com/tymondesigns/jwt-auth

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question