Skip to content

[Bug #32446] Assuming identity is very slow #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 69 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
e6147fb
Devise provider- don't store sign_in details
dylanjha Feb 17, 2015
fe984ea
security :guardsman:
sergey-alekseev Mar 25, 2015
987a673
Merge pull request #68 from MustWin/master
flyerhzm Mar 28, 2015
41703f7
Merge pull request #70 from sergey-alekseev/master
flyerhzm Mar 28, 2015
bc007ed
Revert "Allow routes to be disabled"
flyerhzm Jun 16, 2015
d18b453
Revert "Devise provider- don't store sign_in details"
flyerhzm Jun 16, 2015
aab2f22
use rspec 3.3.0
flyerhzm Jun 16, 2015
a979673
add travis-ci
flyerhzm Jun 16, 2015
837f3ac
Devise provider- don't store sign_in details
dylanjha Jun 17, 2015
5b53632
add README note to run tests
dylanjha Jun 17, 2015
8dd6902
Merge pull request #74 from MustWin/master
flyerhzm Jun 17, 2015
cdef839
only load necessary data #72
flyerhzm Jun 20, 2015
3827d60
Bumping version to 1.0.0
flyerhzm Jun 22, 2015
77ce40a
update README
flyerhzm Jun 22, 2015
775dd28
GuestDataSource#users should be renamed to GuestDataSource#all #75
flyerhzm Jun 23, 2015
03be237
allow custom method as available_users_names
flyerhzm Jun 26, 2015
501a372
Bumping version to 1.0.1
flyerhzm Jun 26, 2015
e8705c0
1. Use String#sub, not String#delete to remove scope str from scope_i…
etipton Jun 27, 2015
3c606c5
Merge pull request #76 from renterup/sub_not_delete
flyerhzm Jun 27, 2015
464f285
Bumping version to 1.0.2
flyerhzm Jun 29, 2015
a0e0de1
rails 3.2 compatibility
flyerhzm Jul 1, 2015
7d7719d
Bumping version to 1.1.0
flyerhzm Jul 1, 2015
1e83673
replace select option to group_option
vkill Sep 19, 2015
bd39823
add helper rspec
vkill Sep 19, 2015
9d883f2
Merge pull request #82 from vkill/master
flyerhzm Sep 20, 2015
57efa2a
update README for rails 3.2
flyerhzm Dec 1, 2015
12004c3
Bumping version to 1.2.0
flyerhzm Dec 1, 2015
075d10f
fix grouped_options_for_select bug for rails 3.2
vkill Dec 22, 2015
39a52e9
Merge pull request #86 from vkill/master
flyerhzm Dec 22, 2015
18cc9f9
Bumping version to 1.2.1
flyerhzm Dec 22, 2015
f7df7bf
add class and style options to switch_user_select
westonganger Feb 11, 2016
2f28311
fix travis setting
flyerhzm Feb 11, 2016
e7cff85
fix selected_user_of_helper bug
vkill Apr 14, 2016
a0a0bd7
support capybara
vkill Apr 16, 2016
6e8531f
fix 'rspec do not raise exception' but
vkill Apr 16, 2016
1019be5
rename /dummys/open to /dummy/open
vkill Apr 16, 2016
0b5d021
edit rspec/feature_helpers_spec.rb
vkill Apr 16, 2016
b9ec5e6
Update switch_user_controller.rb
colorfulberry Apr 18, 2016
d7825ce
Merge pull request #90 from colorfulberry/patch-1
flyerhzm Apr 19, 2016
93d8cd4
Merge pull request #89 from vkill/hotfix/rspec_do_not_raise_exception
flyerhzm Apr 19, 2016
b390489
Merge branch 'master' into feature/support_capybara
vkill Apr 20, 2016
9f76149
Merge pull request #91 from vkill/feature/support_capybara
flyerhzm Apr 20, 2016
d7d6f9d
make it work with relative url root
westonganger Jul 21, 2016
3dff40e
Merge pull request #87 from westonganger/master
flyerhzm Jul 22, 2016
3549e35
fix travis
flyerhzm Jul 22, 2016
be1d086
remove Rails.relative_root_url
flyerhzm Jul 22, 2016
fc1e1db
apply before each only for type feature
flyerhzm Jul 23, 2016
25ab079
Bumping version to 1.3.0
flyerhzm Jul 23, 2016
1a474df
Merge pull request #88 from vkill/hotfix/selected_user_of_helper
flyerhzm Jul 23, 2016
5258eac
Respect the relative_url_root for applications deployed to sub-direct…
westonganger Jul 22, 2016
e7b4f98
Respect relative_url_root
westonganger Jul 23, 2016
17e8fc3
Merge pull request #95 from westonganger/master
flyerhzm Jul 24, 2016
35fdffa
Bumping version to 1.3.1
flyerhzm Aug 21, 2016
92d4e00
add ability to store_sign_in info with devise provider
westonganger Oct 3, 2016
933b613
Merge pull request #100 from westonganger/master
flyerhzm Oct 5, 2016
e2a7bb8
Bumping version to 1.4.0
flyerhzm Oct 21, 2016
dd0b6b1
Allow `SwitchUser.switch_back` to be considered even when not calling
MarcusSky Oct 25, 2016
1d45ec9
change controller and add spec
prem-prakash Nov 16, 2016
aa57c81
Rails.env.production?
stereodenis Jan 20, 2017
8499bdc
Merge pull request #102 from stereodenis/patch-1
flyerhzm Jan 20, 2017
1ed426e
Merge pull request #103 from jaya/master
flyerhzm Feb 18, 2017
86d2e1f
use new syntax
flyerhzm Feb 18, 2017
e828646
Fix 'available_users' config syntax
rubendinho Mar 2, 2017
a59be6a
Merge pull request #104 from rubendinho/patch-1
flyerhzm Mar 2, 2017
9f799fb
updated documentation about before_action in Rails < 4
Mar 18, 2017
1d32080
updated documentation about before_action in Rails < 4
Mar 18, 2017
f2b328c
Merge pull request #105 from acesuares/master
flyerhzm Mar 19, 2017
2f73206
Merge remote-tracking branch 'upstream/master' into rm32446
aomran May 1, 2017
89af98f
bump version
aomran May 1, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Allow SwitchUser.switch_back to be considered even when not calling
`#remember_user`.

We need to be able to tell the gem that we want the user to be
remembered so that we can switch back to it. It was unclear how it
should've been done, so this is making sure that we don't have to make
two calls to the `SwitchUser API`, just to make sure the original user
will be remembered.

Related Issue: flyerhzm/issues/55
  • Loading branch information
MarcusSky committed Oct 25, 2016
commit dd0b6b13669f93c0b011290053fafafacd314ffd
13 changes: 7 additions & 6 deletions app/controllers/switch_user_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class SwitchUserController < ApplicationController
before_action :developer_modes_only
before_action :developer_modes_only, :switch_back

def set_current_user
handle_request(params)
Expand All @@ -8,16 +8,17 @@ def set_current_user
end

def remember_user
# NOOP unless the user has explicity enabled this feature
if SwitchUser.switch_back
provider.remember_current_user(params[:remember] == "true")
end

redirect_to(SwitchUser.redirect_path.call(request, params))
end

private

def switch_back
if SwitchUser.switch_back
provider.remember_current_user(params[:remember] == "true")
end
end

def developer_modes_only
raise ActionController::RoutingError.new('Do not try to hack us.') unless available?
end
Expand Down