mirror of
https://github.com/System-End/theseus.git
synced 2026-04-20 00:35:18 +00:00
11 lines
No EOL
301 B
Ruby
11 lines
No EOL
301 B
Ruby
class ExternalToken < SimpleStructuredSecrets
|
|
def initialize(type)
|
|
@org = "th"
|
|
@type = type
|
|
end
|
|
|
|
def generate
|
|
random = base62_encode(SecureRandom.rand(10 ** 60)).to_s[0...30]
|
|
"#{@org}_#{@type}_#{Rails.env.production? ? "live" : "dev"}_#{random}#{calc_checksum(random)}"
|
|
end
|
|
end |