简体   繁体   中英

Getting Auth guard [web] is not defined in Lumen

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

Please change your default guard to web

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM