Validate rs/oauth redirect_uri before storing return URL

This commit is contained in:
2026-08-10 11:21:33 -06:00
parent 7a892fad4e
commit a62d84e20a
2 changed files with 18 additions and 4 deletions
@@ -222,6 +222,19 @@ RSpec.describe Rs::OauthController, type: :controller do
expect(response).to redirect_to(new_user_session_path(cn: user.cn, ou: user.ou))
end
context "without a redirect_uri" do
it "returns a 400 without storing the return location" do
get :new, params: {
username: user.cn,
scope: "documents,photos",
client_id: "https://example.com"
}
expect(response.response_code).to eq(400)
expect(session[:user_return_to]).to be_nil
end
end
end
describe "root access" do