Skip to content

Instantly share code, notes, and snippets.

@Heavyblade
Created June 20, 2012 21:59
Show Gist options
  • Select an option

  • Save Heavyblade/2962479 to your computer and use it in GitHub Desktop.

Select an option

Save Heavyblade/2962479 to your computer and use it in GitHub Desktop.
#How hostname is configured
if Rails.env == "production"
ENV["HOSTNAME"] = "auth.tfoundry.com"
elsif Rails.env == "staging"
ENV["HOSTNAME"] = "alpha-auth.stage.tfoundry.com"
else
ENV["HOSTNAME"] = "localhost"
end
#the Method that handle the issue in Mobile model
def send_sms_token
confirm_number_url = confirmation_identifier_url(:host => ENV["HOSTNAME"], :id => self.id, :confirmation_token => self.confirmation_token)
confirm_user_url = user_confirmation_url(:host => ENV["HOSTNAME"], :confirmation_token => self.user.confirmation_token)
url = self.primary ? confirm_user_url : confirm_number_url
res = IpxSMS.send_sms("#{self.value}", "Confirm AT&T access: #{url}")
Rails.logger.info res.inspect
res
end
#Generated links that are being send in local and works
#When creating a user, the confirmation link
http://localhost/users/confirmation?confirmation_token=7qbmkXTfzQoYFy93yDp3
#When adding a new phone number
http://localhost/identifiers/49/confirmation?confirmation_token=1537
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment