silvermobi/handler/update_password.go

19 lines
417 B
Go
Raw Permalink Normal View History

2023-08-08 10:28:43 +00:00
package handler
import "context"
2024-10-31 19:32:54 +00:00
func (h *SilverMobiHandler) UpdatePassword(ctx context.Context, username string, password string) (response bool) {
2023-08-08 10:28:43 +00:00
account, err := h.Services.MobilityAccounts.GetAccountUsername(ctx, username, "silvermobi")
if err != nil {
return false
}
2024-10-31 19:32:54 +00:00
2023-08-08 10:28:43 +00:00
result := h.Services.MobilityAccounts.UpdatePassword(ctx, account.ID, password)
if result == true {
return true
}
2024-10-31 19:32:54 +00:00
return false
2023-08-08 10:28:43 +00:00
}