-
Notifications
You must be signed in to change notification settings - Fork 45
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
Token delete formdata fix method #53
base: master
Are you sure you want to change the base?
Conversation
Why the change if the AJAX is sent over GET and not POST? |
{ | ||
if (res["status"] =='OK') | ||
$("#res").html("<div class='alert alert-success'>Registered Successfully, <a href='"+formData.get('redirect')+"'> "+formData.get('success')+"</a></div>") | ||
else |
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.
Dont you need these with {% trans %}?
|
||
|
||
}, function(reason) { | ||
$("#res").html("<div class='alert alert-danger'>Registeration Failed as " +reason +", <a href='javascript:void(0)' onclick='begin_reg()'> try again </a> or <a href='"+formData.get('home')+"'> Go to Security Home</a></div>") |
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 as well?
} | ||
else { | ||
$("#msgdiv").addClass("alert alert-danger").removeClass("alert-success") | ||
$("#msgdiv").html("Verification Failed as " + res.message + ", <a href='javascript:void(0)' onclick='authen())'> try again</a> or <a href='javascript:void(0)' onclick='history.back()'> Go Back</a>") |
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 too?
mfa/static/mfa/js/U2F/recheck.js
Outdated
} | ||
else if(formData.get('mode') === 'recheck') { | ||
$.ajax({ | ||
"url":"{% url 'u2f_recheck' %}", |
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 won’t work under {% static %}
mfa/static/mfa/js/delete-token.js
Outdated
function deleteKey(id,name,confirm_url) | ||
{ | ||
$("#modal-title").html("Confirm Delete") | ||
$("#modal-body").html("Are you sure you want to delete '"+name+"'? you may lose access to your system if this your only 2FA."); |
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.
Shall be translated, isn’t it?
window.mfa_success_function=success_func; | ||
window.mfa_failed_function=fail_func; | ||
$.ajax({ | ||
"url":"{% url 'mfa_recheck' %}", |
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.
Wont work with static
} | ||
else | ||
{ | ||
$("#modal-title").html("Recheck Indentity") |
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.
Shall be translated, isn’t it?
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.
sorry, I'm not done yet, my intention was to do internationalization and be CSP conform without inline javascript or css. I will provide further updates soon.
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.
Thanks for the effort, please consider the comment
Hello, Any updates about this PR. |
Still on it, to aquire strict CSP rules conformity, we have to rewrite some javascript. |
Ok, can you share the rules and i can work with you on them, thanks for your help |
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.
Did you test this version? as it wont work as the AJAX gets the URLs through a {%url%} tag which wont work with static JS.
I now stripped as recomended all url tags from js files see my latest implemenetation master...AndreasDickow:master. Can you please review the code? |
update yubikey compatibility
update Setup requirements
We have now included translation tags for international usage and added a german translation of Status Messages. Additional the library is now conform with strict CSP settings not allowing javascript and style in html files. |
Delete token used the wrong method to access formdata, I exchanged it to POST instead of GET and it fixed the error on submit