1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-22 17:10:10 +00:00

users: attach Jellyfin ID to contactMethodUser

This commit is contained in:
Harvey Tindall 2024-08-04 13:40:16 +01:00
parent 54e4a51a7f
commit 280c6e4f16
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2

View File

@ -37,6 +37,11 @@ func (app *appContext) NewUserFromAdmin(gc *gin.Context) {
gc.BindJSON(&req) gc.BindJSON(&req)
profile := app.storage.GetDefaultProfile() 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{ nu := app.NewUserPostVerification(NewUserParams{
Req: req, Req: req,
SourceType: ActivityAdmin, SourceType: ActivityAdmin,
@ -225,6 +230,7 @@ func (app *appContext) NewUserFromInvite(gc *gin.Context) {
nonEmailContactMethodEnabled = true nonEmailContactMethodEnabled = true
} }
app.contactMethods[i].DeleteVerifiedToken(c.PIN) app.contactMethods[i].DeleteVerifiedToken(c.PIN)
c.User.SetJellyfin(nu.User.ID)
c.User.Store(&(app.storage)) c.User.Store(&(app.storage))
} }
} }