func (app *OAuth2Application) GenerateClientSecret() (string, error) {
	clientSecret, err := secret.New()
	if err != nil {
		return "", err
	}
	hashedSecret, err := bcrypt.GenerateFromPassword([]byte(clientSecret), bcrypt.DefaultCost)
	if err != nil {
		return "", err
	}
	app.ClientSecret = string(hashedSecret)
	if _, err := x.ID(app.ID).Cols("client_secret").Update(app); err != nil {
		return "", err
	}
	return clientSecret, nil
}
// GenerateClientSecret will generate the client secret and returns the plaintext and saves the hash at the database
GenerateClientSecret will generate the client secret and returns the plaintext and saves the hash at the database
// GenerateClientSecret will generate the client secret and returns the plaintext and saves the hash at the database
func (app *OAuth2Application) GenerateClientSecret() (string, error) {
	clientSecret, err := secret.New()
	if err != nil {
		return "", err
	}
	hashedSecret, err := bcrypt.GenerateFromPassword([]byte(clientSecret), bcrypt.DefaultCost)
	if err != nil {
		return "", err
	}
	app.ClientSecret = string(hashedSecret)
	if _, err := x.ID(app.ID).Cols("client_secret").Update(app); err != nil {
		return "", err
	}
	return clientSecret, nil
}
func ( app * OAuth2Application ) GenerateClientSecret ( ) ( string , error ) { clientSecret , err := secret . New ( ) if err != nil { return " " , err } hashedSecret , err := bcrypt . GenerateFromPassword ( [ ] byte ( clientSecret ) , bcrypt . DefaultCost ) if err != nil { return " " , err } app . ClientSecret = string ( hashedSecret ) if _ , err := x . ID ( app . ID ) . Cols ( " " ) . Update ( app ) ; err != nil { return " " , err } return clientSecret , nil }
GenerateClientSecret will generate the client secret and returns the plaintext and saves the hash at the database
GenerateClientSecret will generate the client secret and returns the plaintext and saves the hash at the database