mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Merge branch 'develop' of https://github.com/Kareadita/Kavita into develop
This commit is contained in:
commit
b0b371cebb
@ -35,11 +35,13 @@ namespace API
|
|||||||
|
|
||||||
public static async Task Main(string[] args)
|
public static async Task Main(string[] args)
|
||||||
{
|
{
|
||||||
|
Console.OutputEncoding = System.Text.Encoding.UTF8;
|
||||||
|
|
||||||
// Before anything, check if JWT has been generated properly or if user still has default
|
// Before anything, check if JWT has been generated properly or if user still has default
|
||||||
if (!Configuration.CheckIfJwtTokenSet(GetAppSettingFilename()) && Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") != Environments.Development)
|
if (!Configuration.CheckIfJwtTokenSet(GetAppSettingFilename()) && Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") != Environments.Development)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Generating JWT TokenKey for encrypting user sessions...");
|
Console.WriteLine("Generating JWT TokenKey for encrypting user sessions...");
|
||||||
var rBytes = new byte[24];
|
var rBytes = new byte[128];
|
||||||
using (var crypto = new RNGCryptoServiceProvider()) crypto.GetBytes(rBytes);
|
using (var crypto = new RNGCryptoServiceProvider()) crypto.GetBytes(rBytes);
|
||||||
var base64 = Convert.ToBase64String(rBytes).Replace("/", "");
|
var base64 = Convert.ToBase64String(rBytes).Replace("/", "");
|
||||||
Configuration.UpdateJwtToken(GetAppSettingFilename(), base64);
|
Configuration.UpdateJwtToken(GetAppSettingFilename(), base64);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user