From bda7ffaae83ab4942f5dcb2aab628d91180f375f Mon Sep 17 00:00:00 2001 From: iven <99438726+ivenos@users.noreply.github.com> Date: Wed, 7 Oct 2026 18:47:59 +0200 Subject: Return the created API key from POST /Auth/Keys (#17155) * Return the created API key from POST /Auth/Keys * Keep the other API key fields in the DTO --- .../Security/AuthenticationManager.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'Jellyfin.Server.Implementations/Security/AuthenticationManager.cs') diff --git a/Jellyfin.Server.Implementations/Security/AuthenticationManager.cs b/Jellyfin.Server.Implementations/Security/AuthenticationManager.cs index cf0293463f..2bc7b9f915 100644 --- a/Jellyfin.Server.Implementations/Security/AuthenticationManager.cs +++ b/Jellyfin.Server.Implementations/Security/AuthenticationManager.cs @@ -23,14 +23,25 @@ namespace Jellyfin.Server.Implementations.Security } /// - public async Task CreateApiKey(string name) + public async Task CreateApiKey(string name) { var dbContext = await _dbProvider.CreateDbContextAsync().ConfigureAwait(false); await using (dbContext.ConfigureAwait(false)) { - dbContext.ApiKeys.Add(new ApiKey(name)); + var apiKey = new ApiKey(name); + dbContext.ApiKeys.Add(apiKey); await dbContext.SaveChangesAsync().ConfigureAwait(false); + + return new AuthenticationInfo + { + AppName = apiKey.Name, + AccessToken = apiKey.AccessToken, + DateCreated = apiKey.DateCreated, + DeviceId = string.Empty, + DeviceName = string.Empty, + AppVersion = string.Empty + }; } } -- cgit v1.2.3