Hi fellow coders,

I have recently been implementing an API and used Basic Auth as the 
authentication method. Besides doing the authentication part, I need to 
extract the email from the request header for other usages.

Currently, we can extract username the following way: 
username = 
ActionController::HttpAuthentication::Basic::user_name_and_password[0]

But I wanted to propose to add two new methods: One for getting the 
username, and the other one for taking the password, so that we do not need 
to use array indexes to get each one. Then we can refactor 
ActionController::HttpAuthentication::Basic::user_name_and_password and 
prepare the response from these new methods.

This sounds as something really simple, that may not be that important, but 
I believe it greatly fits with the central principle of Ruby, as Matz says:
“Ruby is designed to make programmers happy.” 

If this does resonate with you, I would be more than happy and grateful to 
implement it.

Thank you very much. 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to