Sha256: ce1ba3217e73fd449a3d1ba9b8d78fac342eb9c2eff08f841ef849cda64cb6fd
Contents?: true
Size: 1.12 KB
Versions: 80
Compression:
Stored size: 1.12 KB
Contents
module Registrations::ControllerBase extend ActiveSupport::Concern included do def new if invitation_only? unless session[:invitation_uuid] || session[:invitation_key] return redirect_to root_path end end # do all the regular devise stuff. super end def create # do all the regular devise stuff first. super # if current_user is defined, that means they were successful registering. if current_user # TODO i think this might be redundant. we've added a hook into `session["user_return_to"]` in the # `invitations#accept` action and that might be enough to get them where they're supposed to be after # either creating a new account or signing into an existing account. handle_outstanding_invitation # if the user doesn't have a team at this point, create one. unless current_user.teams.any? current_user.create_default_team end # send the welcome email. current_user.send_welcome_email unless current_user.email_is_oauth_placeholder? end end end end
Version data entries
80 entries across 80 versions & 1 rubygems