Class: UserAuthenticationsController
- Inherits:
-
Spree::BaseController
- Object
- Spree::BaseController
- UserAuthenticationsController
- Defined in:
- app/controllers/user_authentications_controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/user_authentications_controller.rb', line 20 def destroy @auth = current_user.user_authentications.find(params[:id]) :destroy, @auth @auth.destroy flash[:notice] = "Successfully deleted authentication source." redirect_to account_path end |
#update ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/user_authentications_controller.rb', line 3 def update @user = User.find(params[:id]) :edit, @user, session[:user_access_token] session[:user_access_token] = nil @user.email = params[:user][:email] if @user.save sign_in(@user, :event => :authentication) unless current_user redirect_back_or_default(products_path) else flash.now[:error] = "There is already an account with that email. Please sign in to associate these accounts." render(:template => 'users/merge') end end |