isaacsanders / omniauth-stripe-connect

Stripe Connect OAuth2 Strategy for OmniAuth 1.0
MIT License
130 stars 74 forks source link

user session not storing after callback #39

Closed dedles closed 8 years ago

dedles commented 8 years ago

My controller looks like so:

class OmniauthCallbacksController < Devise::OmniauthCallbacksController 
    def stripe_connect
        @user = current_user
            if @user.update_attributes({
               provider: request.env["omniauth.auth"].provider,
               uid: request.env["omniauth.auth"].uid,
               access_code: request.env["omniauth.auth"].credentials.token,
               publishable_key: request.env["omniauth.auth"].info.stripe_publishable_key
               })
              redirect_to teacher_path(current_user.teacher.id), :event => :authentication
              set_flash_message(:notice, :success, :kind => "Stripe") if is_navigational_format?
           else
              session["devise.stripe_connect_data"] = request.env["omniauth.auth"]
              redirect_to new_user_registration_url
          end
    end  
end

This works in development but not in production. In production is says @user is nil. How could one pull the user session from the callback in production?

lskd commented 8 years ago

hey @dedles , did you get this to work for you?

isaacsanders commented 8 years ago

If @user is nil, it might be an issue with the OmniAuth setup.

isaacsanders commented 8 years ago

Any word on this?

dedles commented 8 years ago

I reverted back to an earlier commit and rewrote the code from scratch. Somehow, it started working although I'm not even sure what it was that caused the issue.