global

def from_basic(request)

def from_basic(request)
  authorization = request.authorization
  if authorization.present? && authorization =~ /^Basic (.*)/m
    Base64.decode64(Regexp.last_match(1)).split(/:/, 2)
  end
end