Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $eposta = "example@gmail.com";
- $sifre = "123456";
- $query = $this-db->getUser("...") // kullanıcının bilgilerini alıyoruz
- /** kullanıcı dataları bunları tokene atıcaz **/
- $userData = [
- 'id' => 1,
- 'eposta' => 'example@gmail.com',
- 'telno' => 'xxx-xxx-xx-xx';
- 'yetkiler' => [
- 'uye_silme' => true,
- 'uye_ekleme' => true,
- ]
- ];
- $jwt_olustur = new JWT($userData);
- echo $jwt; // token bu
- /** JWT TOKENI ÇÖZELİM **/
- $tokenCöz = new JWT_COZ($jwt);
- // Çözülen Token
- $userData = [
- 'id' => 1,
- 'eposta' => 'example@gmail.com',
- 'telno' => 'xxx-xxx-xx-xx';
- 'yetkiler' => [
- 'uye_silme' => true,
- 'uye_ekleme' => true,
- ]
- ];
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement