silvermobi/handler/update_password.go

17 lines
425 B
Go

package handler
import "context"
func (h *SilvermobiHandler) UpdatePassword(ctx context.Context, username string, password string) (response bool) {
account, err := h.Services.MobilityAccounts.GetAccountUsername(ctx, username, "silvermobi")
if err != nil {
return false
}
result := h.Services.MobilityAccounts.UpdatePassword(ctx, account.ID, password)
if result == true {
return true
} else {
return false
}
}