salt passwords using userid

This commit is contained in:
mungai-njoroge
2024-05-03 23:22:09 +03:00
parent 5d947f3ad9
commit fdf3186be6
10 changed files with 42 additions and 30 deletions
+5 -4
View File
@@ -9,8 +9,9 @@ from flask_compress import Compress
from flask_openapi3 import Info
from flask_openapi3 import OpenAPI
from flask_jwt_extended import JWTManager
from app.config import UserConfig
from app.settings import Keys
from app.settings import Info as AppInfo
from .plugins import lyrics as lyrics_plugin
from app.db.sqlite.auth import SQLiteAuthMethods as authdb
from app.api import (
@@ -57,14 +58,14 @@ def create_api():
"""
api_info = Info(
title=f"Swing Music",
version=f"v{Keys.SWINGMUSIC_APP_VERSION}",
version=f"v{AppInfo.SWINGMUSIC_APP_VERSION}",
description=open_api_description,
)
app = OpenAPI(__name__, info=api_info, doc_prefix="/docs")
print("userid", UserConfig().userId)
# JWT CONFIGS
app.config["JWT_SECRET_KEY"] = Keys.JWT_SECRET_KEY
app.config["JWT_SECRET_KEY"] = UserConfig().userId
app.config["JWT_TOKEN_LOCATION"] = ["cookies"]
app.config["JWT_COOKIE_CSRF_PROTECT"] = False
app.config["JWT_ACCESS_TOKEN_EXPIRES"] = datetime.timedelta(days=1)
+3 -3
View File
@@ -10,7 +10,7 @@ from app.db.sqlite.settings import SettingsSQLMethods as sdb
from app.lib import populate
from app.lib.watchdogg import Watcher as WatchDog
from app.logger import log
from app.settings import Keys, Paths, SessionVarKeys, set_flag
from app.settings import Info, Paths, SessionVarKeys, set_flag
from app.store.albums import AlbumStore
from app.store.artists import ArtistStore
from app.store.tracks import TrackStore
@@ -193,7 +193,7 @@ def get_all_settings():
root_dirs = sdb.get_root_dirs()
s["root_dirs"] = root_dirs
s["plugins"] = plugins
s["version"] = Keys.SWINGMUSIC_APP_VERSION
s["version"] = Info.SWINGMUSIC_APP_VERSION
return {
"settings": s,
@@ -292,4 +292,4 @@ def update_config(body: UpdateConfigBody):
return {
"msg": "Config updated!",
}
}