Skip to content

Decode fails only on IOS #34

@mplumador

Description

@mplumador

Describe the bug
Utilizing the same secret, and same JWT results in different results when trying to decode on android vs IOS. Decoding is successful on android, but results in "Error: Decoding failed" error on IOS.

To Reproduce
Here is an example that is currently producing this inconsistency on my devices.

import { decode } from 'react-native-pure-jwt'
const test_decode = async () => {
    try {
      let test_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXJpYWxfbnVtYmVyIjoiNWYxMGExNjMtMjk2OC00ZDZkLWIyZDgtOGQxNjQwMDNlMmQ0Iiwic2VxIjo1MTI4MTYsIm5hbWUiOiJOYW1lMSIsImlkIjo2NTQsImRlc2NyaXB0aW9uIjoiVGVzdCBEZWNvZGluZyJ9.ahLaTEhdgonxb8rfLG6NjcIg6rqbGzcHkwwFtvb9KTE";
      let test_key = "SuperSecretKey";
      let test_result = await decode(test_token, test_key);
      console.log(test_result);
      } catch(error) {
        console.warn(error);
    }
  }
  test_decode();

Expected behavior
Decoding should be consistent across platforms when given the same information on both.

Smartphone (please complete the following information):

  • Devices: IPhone XR, Samsung S9+

Please let me know if there is more information needed or if I am utilizing this function incorrectly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions