-
Notifications
You must be signed in to change notification settings - Fork 48
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
sanitize_token()
#144
Comments
This seems reasonable, and also more proactive. If a token somehow comes up with something not alphanumeric, this will catch it before sending it to the server and probably give a more satisfying error message to the user. |
wibeasley
added a commit
that referenced
this issue
Mar 24, 2017
wibeasley
added a commit
that referenced
this issue
Mar 24, 2017
wibeasley
added a commit
that referenced
this issue
Mar 25, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(@nutterb recommended an explicit token sanitizing function in #133.)
@nutterb, I like your idea for a token validation function. I'm fine with pulling out @haozhu233's code into an explicit function, and/or replacing the
gsub()
withsubstr()
. Or maybe a compromise between regex & substrings likeOnce we have the explicit function, we could accommodate variations in future REDCap version. Like
sprintf("^([0-9A-F]{%i})(?:\\n)?$", token_length)
if it ever expands beyond 32 characters.The text was updated successfully, but these errors were encountered: