Skip to content

Commit ff2224f

Browse files
Ignore anything that isn't a URI path when returning
Co-Authored-By: Corrie <[email protected]>
1 parent 85b51fe commit ff2224f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

app/controllers/kracken/sessions_controller.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# frozen_string_literal: true
22

33
module Kracken
4-
class SessionsController < ActionController::Base
4+
class SessionsController < ActionController::Base # rubocop:disable Rails/ApplicationController
55
protect_from_forgery with: :exception
66

7-
def create
7+
def create # rubocop:disable Metrics/AbcSize
88
@user = user_class.find_or_create_from_auth_hash(auth_hash)
99
session[:user_id] = @user.id
1010
session[:user_uid] = @user.uid
@@ -24,10 +24,12 @@ def failure
2424
render text: "Sorry, but you didn't allow access to our app!"
2525
end
2626

27-
protected
27+
protected
2828

2929
def return_to_path
30-
request.env['omniauth.origin'] || "/"
30+
return "/" unless request.env['omniauth.origin'].starts_with?('/')
31+
32+
request.env['omniauth.origin']
3133
end
3234

3335
def auth_hash

0 commit comments

Comments
 (0)