From dda363b3446c4ac187ea01d2ccecdbcb475ab7d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastien=20Vid=C3=A9?= Date: Fri, 22 Nov 2024 02:44:18 +0100 Subject: [PATCH] fix: added discord and telegram linking verification on sign up page --- api-users.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api-users.go b/api-users.go index e865b27..3d531d3 100644 --- a/api-users.go +++ b/api-users.go @@ -337,11 +337,13 @@ func (app *appContext) PostNewUserFromInvite(nu NewUserData, req ConfirmationKey // FIXME: figure these out in a nicer way? this relies on the current ordering, // which may not be fixed. if discordEnabled { - discordUser = req.completeContactMethods[0].User.(*DiscordUser) - if telegramEnabled { + if req.completeContactMethods[0].User != nil { + discordUser = req.completeContactMethods[0].User.(*DiscordUser) + } + if telegramEnabled && req.completeContactMethods[1].User != nil { telegramUser = req.completeContactMethods[1].User.(*TelegramUser) } - } else if telegramEnabled { + } else if telegramEnabled && req.completeContactMethods[0].User != nil { telegramUser = req.completeContactMethods[0].User.(*TelegramUser) } }