-
Notifications
You must be signed in to change notification settings - Fork 9
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
Feature/user auth flow #25
Conversation
7a76163
to
0e728b2
Compare
this.signoutButtonTarget.addEventListener("ajax:success", (event) => | ||
this.signoutUserHandler(event) | ||
); | ||
} |
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.
what's with the guards on these? Are there times when these targets don't exist?
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.
@hcatlin yeah these are alternative when user logged in loginButtonTarget
& hasSignupButtonTarget
doesn't exist. And when use is not login signoutButtonTarget
doesn't exist.
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 we can simplify this with data-actions!
createModal(response, target) { | ||
this.modalLabelTarget.innerHTML = | ||
target === "login" ? "Sign in to Veue" : "Create Account Veue"; | ||
document.body.style.overflowY = "hidden"; |
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.
Why do we have to change the overflow on the body when this shows up? I'd at least document this!
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.
@hcatlin we change overflowY to stop background page scroll otherwise it will scroll while showing model.
- else | ||
%ul | ||
%li | ||
= link_to "Login", "javascript:void(0)", class: "list-item", data: { target: "authentication.loginButton" } |
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.
OH! I think you really want data-actions here! data: { action: "click->authentication.login" }
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 explains why you have that whole wiring up event listeners if statements... none of that is needed!
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.
Hmm ok. I'll change it and update PR shortly.
5d189a5
to
0e728b2
Compare
0e728b2
to
e70133f
Compare
@@ -4,6 +4,8 @@ class ApplicationController < ActionController::Base | |||
include HttpAuthConcern | |||
include DeviseHelperConcern | |||
|
|||
protect_from_forgery unless: -> { request.format.json? } |
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.
Can you add a TODO here to remove this? Big security hole!
This PR is implementing following functionalities: