// CancelRecovery checks whether the token in the URL is valid and stops
// active verification token from further processing.
CancelRecovery checks whether the token in the URL is valid and stops
active verification token from further processing.
// CancelRecovery checks whether the token in the URL is valid and stops // active verification token from further processing .
func (h *Handler) CancelRecovery(w http.ResponseWriter, r *http.Request) {
	usr, tok, err := h.FetchByToken(r)
	if err != nil {
		httpflow.RespondError(h.log, w, r, err)
		return
	}
	if err = usr.ExposeCore().CancelRecovery(tok); err != nil {
		httpflow.RespondError(h.log, w, r, err)
		return
	}
	if err = h.db.UpdateUser(r.Context(), usr); err != nil {
		httpflow.RespondError(h.log, w, r, err)
		return
	}
	httpflow.Respond(h.log, w, r, nil, http.StatusNoContent)
}
func ( h * Handler ) CancelRecovery ( w http . ResponseWriter , r * http . Request ) { usr , tok , err := h . FetchByToken ( r ) if err != nil { httpflow . RespondError ( h . log , w , r , err ) return } if err = usr . ExposeCore ( ) . CancelRecovery ( tok ) ; err != nil { httpflow . RespondError ( h . log , w , r , err ) return } if err = h . db . UpdateUser ( r . Context ( ) , usr ) ; err != nil { httpflow . RespondError ( h . log , w , r , err ) return } httpflow . Respond ( h . log , w , r , nil , http . StatusNoContent ) }
CancelRecovery checks whether the token in the URL is valid and stops
active verification token from further processing.
CancelRecovery checks whether the token in the URL is valid and stops active verification token from further processing .