0
votes

I want to use web session for authentication in Lumen. Somewhere i found that I can use

Auth::guard('web')->login(compact('username','password'))

for login but it is giving defined error:

Getting Auth guard [web] is not

Let me know if I am missing something or doing it wrong? I want to know how to use session based authentication in Lumen

2
Have you defined a web guard in config/auth.php? - Salim Djerbouh

2 Answers

0
votes

Please change your default guard to web

0
votes

Use the complete Laravel framework instead. Lumen specifically does not come with session support; it is for stateless APIs.

"Since Lumen does not support session state, incoming requests that you wish to authenticate must be authenticated via a stateless mechanism such as API tokens."

Lumen 6.x Docs - Authentication - Introduction