set app id on new signups
This commit is contained in:
parent
840a3fead4
commit
e66f12dcfe
|
@ -148,7 +148,7 @@ type DB interface {
|
||||||
|
|
||||||
// NewSignup creates a new user in the database with the given parameters, with an *unconfirmed* email address.
|
// NewSignup creates a new user in the database with the given parameters, with an *unconfirmed* email address.
|
||||||
// By the time this function is called, it should be assumed that all the parameters have passed validation!
|
// By the time this function is called, it should be assumed that all the parameters have passed validation!
|
||||||
NewSignup(username string, reason string, requireApproval bool, email string, password string, signUpIP net.IP, locale string) (*model.User, error)
|
NewSignup(username string, reason string, requireApproval bool, email string, password string, signUpIP net.IP, locale string, appID string) (*model.User, error)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
USEFUL CONVERSION FUNCTIONS
|
USEFUL CONVERSION FUNCTIONS
|
||||||
|
|
|
@ -415,7 +415,7 @@ func (ps *postgresService) IsEmailAvailable(email string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ps *postgresService) NewSignup(username string, reason string, requireApproval bool, email string, password string, signUpIP net.IP, locale string) (*model.User, error) {
|
func (ps *postgresService) NewSignup(username string, reason string, requireApproval bool, email string, password string, signUpIP net.IP, locale string, appID string) (*model.User, error) {
|
||||||
key, err := rsa.GenerateKey(rand.Reader, 2048)
|
key, err := rsa.GenerateKey(rand.Reader, 2048)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ps.log.Errorf("error creating new rsa key: %s", err)
|
ps.log.Errorf("error creating new rsa key: %s", err)
|
||||||
|
@ -444,6 +444,7 @@ func (ps *postgresService) NewSignup(username string, reason string, requireAppr
|
||||||
SignUpIP: signUpIP,
|
SignUpIP: signUpIP,
|
||||||
Locale: locale,
|
Locale: locale,
|
||||||
UnconfirmedEmail: email,
|
UnconfirmedEmail: email,
|
||||||
|
CreatedByApplicationID: appID,
|
||||||
}
|
}
|
||||||
if _, err = ps.conn.Model(u).Insert(); err != nil {
|
if _, err = ps.conn.Model(u).Insert(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue
Block a user