CodeIgniter Forums
How consume JWT token? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: How consume JWT token? (/showthread.php?tid=75217)



How consume JWT token? - omid_student - 01-13-2020

Hi
In this my project,user try to login and send sms to user and return JWT token
So when user enter confirmation code and login to app and also receive new JWT token
But i need consume or destroy login JWT token until user cannot use prev token for retry login with it token

Here:
1- Login user
2- get token contain code and mobile example
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMSIsIm1vYmlsZSI6IjA5MTI0OTUyNzM1In0.IU_2kJd23sUgC-bNiBHKOofs1mdtyCnfWLEZTuJmsXY

3- user enter confirmation code and send with above token to controller

4- if token is OK,so login to app and create new token

there is a important problem

If user send again -2 token to controller,user can again make new token and receive
but i need destrory relate token example unset session for prevent access use to above token

Thanks