diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-08-02 16:11:01 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-08-02 16:11:01 -0500 |
| commit | 4e19194e6df931c0cfabbb42a361960b306be772 (patch) | |
| tree | 47a4d9c61b96c27fe672ad29fe3cf093f89b8657 | |
| parent | 8ddbd6b40abdb40c1c620a24432dcab71ec30ca7 (diff) | |
| download | invidious-4e19194e6df931c0cfabbb42a361960b306be772.tar.gz invidious-4e19194e6df931c0cfabbb42a361960b306be772.tar.bz2 invidious-4e19194e6df931c0cfabbb42a361960b306be772.zip | |
Fix generation of tokens
| -rw-r--r-- | src/invidious/helpers.cr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/invidious/helpers.cr b/src/invidious/helpers.cr index 28e85469..ebedf281 100644 --- a/src/invidious/helpers.cr +++ b/src/invidious/helpers.cr @@ -900,7 +900,7 @@ def fetch_user(sid, client, headers, db) email = "" end - token = Base64.encode(Random::Secure.random_bytes(32)) + token = Base64.urlsafe_encode(Random::Secure.random_bytes(32)) user = User.new(sid, Time.now, [] of String, channels, email, DEFAULT_USER_PREFERENCES, nil, token, [] of String) return user @@ -908,7 +908,7 @@ end def create_user(sid, email, password) password = Crypto::Bcrypt::Password.create(password, cost: 10) - token = Base64.encode(Random::Secure.random_bytes(32)) + token = Base64.urlsafe_encode(Random::Secure.random_bytes(32)) user = User.new(sid, Time.now, [] of String, [] of String, email, DEFAULT_USER_PREFERENCES, password.to_s, token, [] of String) |
