Skip to content

Commit 0c6d46a

Browse files
authored
fix(authentication): authentication error when the agent uses a prefix path in its url (#fb79c7) (#436)
1 parent 6efa5ed commit 0c6d46a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/controllers/forest_liana/authentication_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def initialize
1717
end
1818

1919
def get_callback_url
20-
URI.join(ForestLiana.application_url, "/forest/#{CALLBACK_AUTHENTICATION_ROUTE}").to_s
20+
File.join(ForestLiana.application_url, "/forest/#{CALLBACK_AUTHENTICATION_ROUTE}").to_s
2121
rescue => error
2222
raise "application_url is not valid or not defined" if error.is_a?(ArgumentError)
2323
end
@@ -70,8 +70,8 @@ def authentication_callback
7070
render json: response_body, status: 200
7171

7272
rescue => error
73-
render json: { errors: [{ status: error.try(:error_code) || 500, detail: error.message }] },
74-
status: error.status || :internal_server_error, serializer: nil
73+
render json: { errors: [{ status: error.try(:error_code) || 500, detail: error.try(:message) }] },
74+
status: error.try(:status) || :internal_server_error, serializer: nil
7575
end
7676
end
7777

0 commit comments

Comments
 (0)