From 4048545151fe467c9d8c8c6fce164788bb36e25f Mon Sep 17 00:00:00 2001 From: Juan Lulkin Date: Mon, 5 Aug 2013 14:54:40 +0300 Subject: [PATCH] Using urlsafe_base64 cause it already handle url sensitive chars, keeping the replacement of the confusing chars, though --- lib/devise.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/devise.rb b/lib/devise.rb index b9a21564..b40ae5cb 100644 --- a/lib/devise.rb +++ b/lib/devise.rb @@ -451,7 +451,7 @@ module Devise # Generate a friendly string randomly to be used as token. def self.friendly_token - SecureRandom.base64(15).tr('+/=lIO0', 'pqrsxyz') + SecureRandom.urlsafe_base64(15).tr('lIO0', 'sxyz') end # constant-time comparison algorithm to prevent timing attacks