Example #1
0
func addKeyInDatabase(key *auth.Key, u *auth.User) error {
	conn, err := db.Conn()
	if err != nil {
		return err
	}
	defer conn.Close()
	u.AddKey(*key)
	return conn.Users().Update(bson.M{"email": u.Email}, u)
}
Example #2
0
func addKeyInDatabase(key *auth.Key, u *auth.User) error {
	u.AddKey(*key)
	return u.Update()
}