-
Notifications
You must be signed in to change notification settings - Fork 0
Charef/taa 252 update the theauthapi code samples js #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Charef/taa 252 update the theauthapi code samples js #2
Conversation
seventy6
commented
Sep 12, 2022
- made a few changes
- null needs to be "null" on customUserId
| featureFlagTwo: false, | ||
| }, | ||
| expiry: new Date("2023-09-01 00:00:00"), // optional expiry date | ||
| expiry: "2023-09-01 00:00:00", // optional expiry date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one works, but I'm curios on why you're favoring expiry as string instead of a date object 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The date object was causing an error when posting to the server. I removed it for speed!
| customUserId: null, | ||
| }) | ||
| console.log('Keys filtered using customUserId', customUserIdFilteredKey); | ||
| customUserId: "null", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think leaving this as null instead of "null" is better, it feels more natural to pass null as null instead of a string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The server borked with the null value.
| featureFlagOne: true, | ||
| featureFlagTwo: false, | ||
| }, | ||
| expiry: new Date("2023-09-01 00:00:00"), // optional expiry date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this works fine, expiry is expected to be a Date object, we want the users to use the library just like any other JS code, passing expiry as a date feels more natural in a JS environment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comment before. Can you test using the JS Date object?