Advertisement
Guest User

Untitled

a guest
Apr 19th, 2017
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. <?php
  2.  
  3. $eposta = "example@gmail.com";
  4. $sifre = "123456";
  5.  
  6. $query = $this-db->getUser("...") // kullanıcının bilgilerini alıyoruz
  7.  
  8. /** kullanıcı dataları bunları tokene atıcaz **/
  9. $userData = [
  10. 'id' => 1,
  11. 'eposta' => 'example@gmail.com',
  12. 'telno' => 'xxx-xxx-xx-xx';
  13. 'yetkiler' => [
  14. 'uye_silme' => true,
  15. 'uye_ekleme' => true,
  16. ]
  17. ];
  18.  
  19. $jwt_olustur = new JWT($userData);
  20.  
  21. echo $jwt; // token bu
  22.  
  23.  
  24. /** JWT TOKENI ÇÖZELİM **/
  25. $tokenCöz = new JWT_COZ($jwt);
  26.  
  27. // Çözülen Token
  28. $userData = [
  29. 'id' => 1,
  30. 'eposta' => 'example@gmail.com',
  31. 'telno' => 'xxx-xxx-xx-xx';
  32. 'yetkiler' => [
  33. 'uye_silme' => true,
  34. 'uye_ekleme' => true,
  35. ]
  36. ];
  37.  
  38.  
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement