app/controllers/kryptonite/user_sessions_controller.rb in kryptonite-0.0.4 vs app/controllers/kryptonite/user_sessions_controller.rb in kryptonite-0.0.5

- old
+ new

@@ -14,19 +14,27 @@ def create @user_session = Kryptonite::UserSession.new params[:kryptonite_user_session] if @user_session.save flash[:notice] = t(:login_successful) - redirect_back_or_default :controller => :kryptonite, :action => :index + if params[:frontend] == "true" + redirect_to("/") + else + redirect_back_or_default :controller => :kryptonite, :action => :index + end else render :action => :new end end def destroy current_user_session.destroy flash[:notice] = t(:logout_successful) - redirect_back_or_default new_kryptonite_user_session_url + if params[:frontend] == "true" + redirect_to("/") + else + redirect_back_or_default new_kryptonite_user_session_url + end end private def requires_no_session_user \ No newline at end of file