diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-16 18:28:52 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-17 18:12:25 +0200 |
| commit | 219626d04cbfd977db087284f6d231cf5d359bf7 (patch) | |
| tree | 57abf910259e00e5edfad24e3c351c8fc11849c9 | |
| parent | cfb2c810e6f6754ceaf3be6cc0a472ec228935a7 (diff) | |
Use SecureRandom instead of the hand rolled implementation
| -rw-r--r-- | lib/authentication.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/authentication.rb b/lib/authentication.rb index a936589..4a3ad46 100644 --- a/lib/authentication.rb +++ b/lib/authentication.rb | |||
| @@ -31,7 +31,7 @@ module Authentication | |||
| 31 | end | 31 | end |
| 32 | 32 | ||
| 33 | def make_token | 33 | def make_token |
| 34 | secure_digest(Time.now, (1..10).map{ rand.to_s }) | 34 | SecureRandom.hex(20) |
| 35 | end | 35 | end |
| 36 | end # class methods | 36 | end # class methods |
| 37 | 37 | ||
| @@ -100,4 +100,4 @@ module Authentication | |||
| 100 | end | 100 | end |
| 101 | end # instance methods | 101 | end # instance methods |
| 102 | end | 102 | end |
| 103 | end \ No newline at end of file | 103 | end |
