4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'app/controllers/ruby_native/auth/sessions_controller.rb', line 4
def show
data = OAuthMiddleware.read_token(params[:token])
unless data
Rails.logger.debug { "[RubyNative] OAuth token exchange failed: invalid or expired token" }
head :unauthorized
return
end
request.session_options[:skip] = true
if data[:cookies].present?
response.["set-cookie"] = data[:cookies].join("\n")
end
Rails.logger.debug { "[RubyNative] OAuth token exchanged, redirecting to #{data[:redirect_url]}" }
render json: {redirect_url: data[:redirect_url]}
end
|