Skip to content

Commit

Permalink
(don't merge yet) Removal of email/username field for MK & SWB (publi…
Browse files Browse the repository at this point in the history
…clab#5640)

* OAuth route creation for MK and SWB

* OAuth routes created

* Github working properly

* Modified the route to accept the provider

* OAuth completed

* removed codeclimate issues

* Documentation added

* test modified

* tests modified

* modified test to have roles

* Travis is passing

* Added OAuth tests

* made travis pass

* username removed from CDSM

* Removed redundant test

* Fixing date issue in subscription mailer (publiclab#5638)

* add nid to rss titles (publiclab#5644)

* Fix scraped image system test bug (publiclab#5646)

* Fix scraped image system test bug

* Update node_test.rb

* Create post_test.rb to test posting at /post (publiclab#5605)

* Create post_test.rb

*     UserSession.create(users(:bob)) # log in

* Update post_test.rb

* Update rich.html.erb

* Update post_test.rb

* Update post_test.rb

* Trying login via modal

* add login-button id

* Update post_test.rb

* Update post_test.rb

* Update post_test.rb

* locators instead of css

"It appears you may be passing a CSS selector or XPath expression rather than a locator. Please see the documentation for acceptable locator values."

* locators instead of css

"It appears you may be passing a CSS selector or XPath expression rather than a locator. Please see the documentation for acceptable locator values."

* Update post_test.rb

* /images/pl.png in scraped image

* /images/pl.png in scraped image

* Update post_test.rb

* add assert_page_reloads

* Update post_test.rb

* Update post_test.rb

* Update post_test.rb

* Update post_test.rb

* fixed image drag and drop bug (publiclab#5657)

* Database tweaks for performance (publiclab#5575)

* Database tweaks for performance

* Reduce innodb buffer pool size because of low memory

* Reduce RAM burden

* Reduce memory consumption following mysqltuner advice.

* Even more conservative limits for RAM

* Update home.html.erb

* Corrected the number of notes appearing on one line (publiclab#5661)

* Some mistakes corrected in notes.html.erb

* Wait 4

* Issue 5259: Used logged_in_as method to replace current_user.role condition (publiclab#5660)

* Update subscriptions.html.erb

* fix logged_in_as in controllers (publiclab#5677)

* fix logged_in_as in controllers

* add wait 4 to system test... odd

* Update subscriptions.html.erb

* Update subscriptions.html.erb

* Bump cytoscape from 3.5.4 to 3.6.0 (publiclab#5662)

Bumps [cytoscape](https://github.com/cytoscape/cytoscape.js) from 3.5.4 to 3.6.0.
- [Release notes](https://github.com/cytoscape/cytoscape.js/releases)
- [Commits](cytoscape/cytoscape.js@v3.5.4...v3.6.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Dashboard system test (publiclab#5682)

* Dashboard system test

* Update dashboard_test.rb

*   Capybara.default_max_wait_time = 5

* fix
  • Loading branch information
SidharthBansal authored and digitaldina committed May 12, 2019
1 parent 5cfd399 commit a1b834b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 33 deletions.
14 changes: 5 additions & 9 deletions app/controllers/openid_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,9 @@ def index

if oidreq

if current_user && !requested_username.casecmp(current_user.username.downcase).zero?
flash[:error] = "You are requesting access to an account that's not yours. Please <a href='/logout'>log out</a> and use the correct account, or <a href='" + oidreq.trust_root + "'>try to login with the correct username</a>"
redirect_to '/dashboard'
else
oidresp = nil
if oidreq.is_a?(CheckIDRequest)

oidresp = nil
if oidreq.is_a?(CheckIDRequest)

identity = oidreq.identity

Expand Down Expand Up @@ -139,12 +136,11 @@ def index
return
end

else
else
oidresp = server.handle_request(oidreq)
end

render_response(oidresp)
end
render_response(oidresp)
else
session[:openid_return_to] = request.env['ORIGINAL_FULLPATH']
if provider
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def create
flash[:notice] += " " + I18n.t('users_controller.continue_where_you_left_off', url1: params[:return_to].to_s)
end
flash[:notice] = flash[:notice].html_safe
flash[:warning] = I18n.t('users_controller.spectralworkbench_or_mapknitter', url1: "'#{session[:openid_return_to]}'").html_safe if session[:openid_return_to]
flash[:warning] = I18n.t('users_controller.spectralworkbench_or_mapknitter', url1: "#{session[:openid_return_to]}'").html_safe if session[:openid_return_to]
session[:openid_return_to] = nil
redirect_to "/dashboard"
end
Expand Down
23 changes: 0 additions & 23 deletions test/integration/openid_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,6 @@ class LoginFlowTest < ActionDispatch::IntegrationTest
test 'attempt to openid authenticate (like from MapKnitter) without being logged in' do
end

test 'incorrect openid authentication request shows error' do

# log in
post '/user_sessions', params: { user_session: { username: users(:jeff).username, password: 'secretive' } }
follow_redirect!

get '/openid', params: {
'openid.claimed_id': 'https://spectralworkbench.org/openid/warren',
'openid.identity': 'https://spectralworkbench.org/openid/warren',
'openid.mode': 'checkid_setup',
'openid.ns': 'http://specs.openid.net/auth/2.0',
'openid.ns.sreg': 'http://openid.net/extensions/sreg/1.1',
'openid.realm': 'https://spectralworkbench.org/',
'openid.return_to': 'https://spectralworkbench.org/session/new?authenticity_token=RcLcGH3lzSTCC24UpPnNm56sllNaMrHg5%2FSrQzNxB%2B4%3D&back_to=&open_id=warren&return_to=',
'openid.sreg.required': 'nickname,email'
}

assert_equal "You are requesting access to an account that's not yours. Please <a href='/logout'>log out</a> and use the correct account, or <a href='https://spectralworkbench.org/'>try to login with the correct username</a>", flash[:error]

assert_response :redirect

end

test 'openid authentication request does not go to index page' do
# test using basic login button on MK or SWB
# log in
Expand Down

0 comments on commit a1b834b

Please sign in to comment.