func (s *AuthServer) GetSignupTokenData(token string) (user string,
	QRImg []byte, hotpFirstValues []string, e error) {

	err := s.AcquireLock("signuptoken"+token, time.Hour)
	if err != nil {
		return "", nil, nil, trace.Wrap(err)
	}

	defer func() {
		err := s.ReleaseLock("signuptoken" + token)
		if err != nil {
			log.Errorf(err.Error())
		}
	}()

	tokenData, err := s.GetSignupToken(token)
	if err != nil {
		return "", nil, nil, trace.Wrap(err)
	}

	_, err = s.GetPasswordHash(tokenData.User.GetName())
	if err == nil {
		return "", nil, nil, trace.Errorf("can't add user %v, user already exists", tokenData.User)
	}

	return tokenData.User.GetName(), tokenData.HotpQR, tokenData.HotpFirstValues, nil
}
// GetSignupTokenData returns token data for a valid token
GetSignupTokenData returns token data for a valid token
// GetSignupTokenData returns token data for a valid token
func (s *AuthServer) GetSignupTokenData(token string) (user string,
	QRImg []byte, hotpFirstValues []string, e error) {
	err := s.AcquireLock("signuptoken"+token, time.Hour)
	if err != nil {
		return "", nil, nil, trace.Wrap(err)
	}
	defer func() {
		err := s.ReleaseLock("signuptoken" + token)
		if err != nil {
			log.Errorf(err.Error())
		}
	}()
	tokenData, err := s.GetSignupToken(token)
	if err != nil {
		return "", nil, nil, trace.Wrap(err)
	}
	_, err = s.GetPasswordHash(tokenData.User.GetName())
	if err == nil {
		return "", nil, nil, trace.Errorf("can't add user %v, user already exists", tokenData.User)
	}
	return tokenData.User.GetName(), tokenData.HotpQR, tokenData.HotpFirstValues, nil
}
func ( s * AuthServer ) GetSignupTokenData ( token string ) ( user string , QRImg [ ] byte , hotpFirstValues [ ] string , e error ) { err := s . AcquireLock ( " " + token , time . Hour ) if err != nil { return " " , nil , nil , trace . Wrap ( err ) } defer func ( ) { err := s . ReleaseLock ( " " + token ) if err != nil { log . Errorf ( err . Error ( ) ) } } ( ) tokenData , err := s . GetSignupToken ( token ) if err != nil { return " " , nil , nil , trace . Wrap ( err ) } _ , err = s . GetPasswordHash ( tokenData . User . GetName ( ) ) if err == nil { return " " , nil , nil , trace . Errorf ( " " , tokenData . User ) } return tokenData . User . GetName ( ) , tokenData . HotpQR , tokenData . HotpFirstValues , nil }
GetSignupTokenData returns token data for a valid token
GetSignupTokenData returns token data for a valid token