//AddCustomerGrantType add customer grant type
AddCustomerGrantType add customer grant type
// AddCustomerGrantType add customer grant type
func (s *Oauth2Server) AddCustomerGrantType(grantType oauth2.GrantType, validator GrantTypeRequestValidator, handleConfigurer HandleConfigurer) {
	for _, t := range s.Config.AllowedGrantTypes {
		if t == grantType {
			panic("grant type already exist")
		}
	}
	s.Config.AllowedGrantTypes = append(s.Config.AllowedGrantTypes, grantType)
	customGrantRequestValidatorMap[grantType] = validator
	if handleConfigurer != nil {
		handleConfigurer(s.AddHandler)
	}
}
func ( s * Oauth2Server ) AddCustomerGrantType ( grantType oauth2 . GrantType , validator GrantTypeRequestValidator , handleConfigurer HandleConfigurer ) { for _ , t := range s . Config . AllowedGrantTypes { if t == grantType { panic ( " " ) } } s . Config . AllowedGrantTypes = append ( s . Config . AllowedGrantTypes , grantType ) customGrantRequestValidatorMap [ grantType ] = validator if handleConfigurer != nil { handleConfigurer ( s . AddHandler ) } }
AddCustomerGrantType add customer grant type
AddCustomerGrantType add customer grant type