Replace method with name conflict causing error

This commit is contained in:
Maikel Linke
2025-12-19 10:16:46 +11:00
parent 7ca43eb4a1
commit ceee9671d9

View File

@@ -14,11 +14,17 @@ module DfcProvider
# We will need to pull the updated data.
def create
unless current_user.is_a? ApiUser
unauthorized "You need to authenticate as authorised platform (client_id)."
render_message(
:unauthorized,
"You need to authenticate as authorised platform (client_id).",
)
return
end
unless current_user.id == "lf-dev"
unauthorized "Your client_id is not authorised on this platform."
render_message(
:unauthorized,
"Your client_id is not authorised on this platform.",
)
return
end
@@ -45,10 +51,6 @@ module DfcProvider
private
def unauthorized(message)
render_message(:unauthorized, message)
end
def render_message(status, message)
render status:, json: { success: false, message: }
end