allow one concurrent user per login with JWT

前端 未结 5 950
闹比i
闹比i 2020-12-16 15:13

We developing an application with Laravel/PHP and we want to use an pay-per-user pricing model. For that we have to ensure that an account can only used by only one concurre

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-16 15:43

    Anyway you need to store token in db.
    For that purpose you will need super fast storage. Redis will be perfect.
    On new login just replace token with new one.
    Every time user makes request check if token matches the one you have in redis. If not then kick him out.

提交回复
热议问题