app/controllers/nyauth/sessions_controller.rb in nyauth-0.2.1 vs app/controllers/nyauth/sessions_controller.rb in nyauth-0.2.2
- old
+ new
@@ -9,15 +9,15 @@
def new
end
def create
sign_in(@session_service.client) if @session_service.save(as: client_name)
- respond_with @session_service, location: Nyauth.configuration.redirect_path_after_sign_in || main_app.root_path
+ respond_with @session_service, location: Nyauth.configuration.redirect_path_after_sign_in.call(client_name) || main_app.root_path
end
def destroy
sign_out
- respond_with @session_service, location: Nyauth.configuration.redirect_path_after_sign_out || new_session_path
+ respond_with @session_service, location: Nyauth.configuration.redirect_path_after_sign_out.call(client_name) || new_session_path
end
private
def set_session_service