// SaveEmailToken saves the given email token with a default expiry.
SaveEmailToken saves the given email token with a default expiry.
// SaveEmailToken saves the given email token with a default expiry .
func SaveEmailToken(token EmailToken) error {
	err := RedisClient.HMSet("token:"+token.Token, map[string]string{
		"type":     strconv.Itoa(int(token.Type)),
		"metadata": token.Metadata,
		"userID":   strconv.Itoa(token.UserID),
	}).Err()
	if err != nil {
		return err
	}
	return RedisClient.Expire("token:"+token.Token, 1*time.Hour).Err()
}
func SaveEmailToken ( token EmailToken ) error { err := RedisClient . HMSet ( " " + token . Token , map [ string ] string { " " : strconv . Itoa ( int ( token . Type ) ) , " " : token . Metadata , " " : strconv . Itoa ( token . UserID ) , } ) . Err ( ) if err != nil { return err } return RedisClient . Expire ( " " + token . Token , 1 * time . Hour ) . Err ( ) }
SaveEmailToken saves the given email token with a default expiry.
SaveEmailToken saves the given email token with a default expiry .