Skip to content

Commit 358e6f3

Browse files
committed
Don't decode secret
1 parent 5feca94 commit 358e6f3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

app/models/user.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ def authenticate_via_courses_mooc_fi(submitted_password)
167167
response = conn.post(auth_url) do |req|
168168
req.headers['Content-Type'] = 'application/json'
169169
req.headers['Accept'] = 'application/json'
170-
req.headers['Authorization'] = Base64.decode64(
171-
Rails.application.secrets.tmc_server_secret_for_communicating_to_secret_project
172-
)
170+
req.headers['Authorization'] = Rails.application.secrets.tmc_server_secret_for_communicating_to_secret_project
173171

174172
req.body = {
175173
user_id: courses_mooc_fi_user_id,
@@ -208,9 +206,7 @@ def update_password_via_courses_mooc_fi(old_password, new_password)
208206
response = conn.post(update_url) do |req|
209207
req.headers['Content-Type'] = 'application/json'
210208
req.headers['Accept'] = 'application/json'
211-
req.headers['Authorization'] = Base64.decode64(
212-
Rails.application.secrets.tmc_server_secret_for_communicating_to_secret_project
213-
)
209+
req.headers['Authorization'] = Rails.application.secrets.tmc_server_secret_for_communicating_to_secret_project
214210

215211
req.body = {
216212
user_id: self.courses_mooc_fi_user_id,

0 commit comments

Comments
 (0)