devise_saml_authenticatable
devise_saml_authenticatable copied to clipboard
Specs changes follow_redirect url to www.example.com
Actual behaviour
When testing Login to ActiveAdmin with saml_authenticable
module my follow_redirect url was change from www.example.com/admin
to www.example.com
. This makes sense for User
but not for AdminUser
Expected behaviour
The existing follow_redirect url should not be modified by saml_authenticable
module, worst case scenario it should be configurable
Related issue #96
Can you provide some example code illustrating the issue? I don't know what redirect URL is changing.
I have a spec like this:
open_session do |session|
session.extend(AdminUserActions)
session.get "/admin/login"
expect(session.response).to have_http_status(:success)
session.post "/admin/login", params: { admin_user: { email: admin.email, password: admin.password, otp_attempt: admin.current_otp, remember_me: "0" }, authenticity_token: session.session["_csrf_token"] }
session.follow_redirect!
expect(session.response).to have_http_status(:success)
end
When executing the session.follow_redirect!
call if you jump into the implementation response.location
should be "http://www.example.com/admin" but it ends up being "http:://www.example.com" somehow.
My guess here is because the saml_authenticable module is built for User model mainly, so step by step generalizing that should solve most of the problems