Created
February 13, 2017 15:59
-
-
Save jemminger/25f5b4dc8504d62792cecf98238ea749 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app/assets/javascripts/check_after_sign_in.js | |
$(function(){ | |
if (Cookies.get("run_hubspot_stuff")){ | |
// run the HS stuff | |
// clear out the cookie | |
Cookies.remove("run_hubspot_stuff"); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/set_after_sign_in.rb | |
# Run code after Devise sign in | |
# http://stackoverflow.com/a/27337802/126636 | |
Warden::Manager.after_set_user except: :fetch do |user, auth, opts| | |
cookies["run_hubspot_stuff"] = true | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment