From c1006efefd1bc2fe8757f223ceedd785746d9ca8 Mon Sep 17 00:00:00 2001 From: d42 Date: Mon, 24 Feb 2020 20:18:33 +0100 Subject: [PATCH] very secure --- bin/application_add.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/application_add.py b/bin/application_add.py index 130774a..f30a5d8 100644 --- a/bin/application_add.py +++ b/bin/application_add.py @@ -1,4 +1,4 @@ -import random +from secrets import token_hex import string from website.app import create_app @@ -44,7 +44,7 @@ c = Client() c.name = app_name c.description = app_description c.client_id = client_id -c.client_secret = ''.join([random.choice("0123456789abcdef") for _ in range(32)]) +c.client_secret = token_hex(32) c.is_confidential = confidential c.redirect_uris_ = redirect_uris