X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/cebda5ffb9bc45171ddc6b4c4a25f14912fdad51..12b4d11d44055399085bf1d10136ffbe4255bcbe:/lib/osm.rb diff --git a/lib/osm.rb b/lib/osm.rb index 905f3ac97..c7f8bef2f 100644 --- a/lib/osm.rb +++ b/lib/osm.rb @@ -502,15 +502,8 @@ module OSM end # Construct a random token of a given length - def self.make_token(length = 30) - chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" - token = "" - - length.times do - token += chars[(rand * chars.length).to_i].chr - end - - token + def self.make_token(length = 24) + SecureRandom.urlsafe_base64(length) end # Return an SQL fragment to select a given area of the globe