Skip to content

Instantly share code, notes, and snippets.

@JosiahSiegel
Last active June 2, 2017 17:17
Show Gist options
  • Save JosiahSiegel/48007c82157e76ebf5d3 to your computer and use it in GitHub Desktop.
Save JosiahSiegel/48007c82157e76ebf5d3 to your computer and use it in GitHub Desktop.
#Rails Generate unique authorization token for user
begin
auth_token = SecureRandom.uuid.gsub(/\-/,'')
end while User.exists?(auth_token: auth_token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment