From 280c6e4f16facda1d52ced267fb363f1949df63f Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sun, 4 Aug 2024 13:40:16 +0100 Subject: [PATCH] users: attach Jellyfin ID to contactMethodUser --- api-users.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api-users.go b/api-users.go index ced54b5..f5c1fc4 100644 --- a/api-users.go +++ b/api-users.go @@ -37,6 +37,11 @@ func (app *appContext) NewUserFromAdmin(gc *gin.Context) { gc.BindJSON(&req) profile := app.storage.GetDefaultProfile() + if req.Profile != "" && req.Profile != "none" { + if p, ok := app.storage.GetProfileKey(req.Profile); ok { + profile = p + } + } nu := app.NewUserPostVerification(NewUserParams{ Req: req, SourceType: ActivityAdmin, @@ -225,6 +230,7 @@ func (app *appContext) NewUserFromInvite(gc *gin.Context) { nonEmailContactMethodEnabled = true } app.contactMethods[i].DeleteVerifiedToken(c.PIN) + c.User.SetJellyfin(nu.User.ID) c.User.Store(&(app.storage)) } }