File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,25 @@ func UpdateUser(UserID uuid.UUID, updatedUser *models.User) error {
233
233
argID ++
234
234
}
235
235
236
+ if updatedUser .TwoFASecret != nil && * updatedUser .TwoFASecret != "" {
237
+ query += "twofa_secret = $" + strconv .Itoa (argID ) + ", "
238
+ args = append (args , updatedUser .TwoFASecret )
239
+ argID ++
240
+ }
241
+
242
+ if updatedUser .TwoFAImage != nil && * updatedUser .TwoFAImage != "" {
243
+ query += "twofa_image = $" + strconv .Itoa (argID ) + ", "
244
+ args = append (args , updatedUser .TwoFAImage )
245
+ argID ++
246
+ }
247
+
248
+ if updatedUser .TwoFAEnabled != false {
249
+ query += "twofa_enabled = $" + strconv .Itoa (argID ) + ", "
250
+ args = append (args , updatedUser .TwoFAEnabled )
251
+ argID ++
252
+
253
+ }
254
+
236
255
// Remove the last comma and space
237
256
query = strings .TrimSuffix (query , ", " )
238
257
You can’t perform that action at this time.
0 commit comments