Add an API to reset the password
This commit is contained in:
		@@ -244,8 +244,13 @@ func (acc *Account) ResetPassword(ctx context.Context, emailConfig email.EmailCo
 | 
			
		||||
	} else if k8serrors.IsAlreadyExists(err) {
 | 
			
		||||
		timestamp := sec.CreationTimestamp.Time
 | 
			
		||||
		now := time.Now()
 | 
			
		||||
		if timestamp.Add(time.Minute).Before(now) {
 | 
			
		||||
			return "", errors.New("You can send an email once per minute, please wait")
 | 
			
		||||
		if timestamp.Add(time.Minute).After(now) {
 | 
			
		||||
			return "", errors.New("you can send an email once per minute, please wait")
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		_, err := clientset.CoreV1().Secrets(acc.Data.UUID).Update(ctx, &secret, metav1.UpdateOptions{})
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return "", err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user