You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f831c3e
Browse filesBrowse the repository at this point in the historyBrowse files
# Fail closed instead of silently authenticating against the stale local hash.
175
185
Rails.logger.error("User #{user.id} is password_managed_by_courses_mooc_fi but has no courses_mooc_fi_user_id; refusing local fallback authentication")
176
-
returnnil
186
+
return[user,:misconfigured]
177
187
end
178
188
179
-
ifuser.has_password?(submitted_password)
180
-
# Locally-managed user logged in: migrate them to courses.mooc.fi
"Authentication via courses.mooc.fi failed for user #{self.email}: status=#{response.status}, request-id=#{response.headers['request-id']}, body=#{response.body.inspect}"
229
+
)
230
+
return:unavailable
231
+
end
232
+
214
233
ifresponse.body == true
215
234
clear_stale_local_password
216
-
returntrue
235
+
return:accepted
217
236
end
218
237
219
238
Rails.logger.warn(
220
239
"Authentication via courses.mooc.fi rejected for user #{self.email}: status=#{response.status}, request-id=#{response.headers['request-id']}, body=#{response.body.inspect}"
221
240
)
222
-
false
241
+
:rejected
223
242
224
243
rescueFaraday::ClientError=>e
225
244
status=e.response&.dig(:status)
226
245
request_id=e.response&.dig(:headers,'request-id')
227
246
body=e.response&.dig(:body)
228
247
Rails.logger.error("Authentication via courses.mooc.fi error for user #{self.email}: status=#{status}, request-id=#{request_id}, body=#{body.inspect}")
0 commit comments