def decrypt(encrypted): fernet = Fernet(to_binary(current_app.config['SECURE_TOKEN_KEY'])) text = fernet.decrypt(to_binary(encrypted)) return to_text(text)