Skip to content

Instantly share code, notes, and snippets.

@jemminger
Created February 13, 2017 15:59
Show Gist options
  • Save jemminger/25f5b4dc8504d62792cecf98238ea749 to your computer and use it in GitHub Desktop.
Save jemminger/25f5b4dc8504d62792cecf98238ea749 to your computer and use it in GitHub Desktop.
// 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");
}
});
# 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