Class: OctopusAuth::TokenGenerator
- Inherits:
-
Object
- Object
- OctopusAuth::TokenGenerator
- Defined in:
- lib/octopus_auth/token_generator.rb
Class Method Summary collapse
Class Method Details
.unique_token ⇒ Object
6 7 8 9 10 11 |
# File 'lib/octopus_auth/token_generator.rb', line 6 def unique_token loop do token = generate(OctopusAuth.configuration.token_length) break token unless OctopusAuth.configuration.model_class.where(token: token).exists? end end |