Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix registration when useEmailAsLogin is true #176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

margori
Copy link
Contributor

@margori margori commented Aug 12, 2017

I set enableRegistration = true and useEmailAsLogin = true in config then try to register but had this exception
Database Exception – yii\db\Exception SQLSTATE[HY000]: General error: 1364 Field 'username' doesn't have a default value The SQL being executed was: INSERT INTO user (email, status, confirmation_token, registration_ip, auth_key, password_hash, created_at, updated_at) VALUES ('[email protected]', 0, 'KDsZuiL2sZRFY7tJiCnU7F-AKqpTOrYD_1502566426', '127.0.0.1', '87i6gDXQydakT53XgOWZT0tya7INq0go', '$2y$13$z3qDng4W4TBEwza28IcjV.zm59kHsTMDH4Y3O9D8.aRkQrKTFyUJu', 1502566430, 1502566430)

so this is me fix to it.

Copy link

@chaitanyareddy14 chaitanyareddy14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@margori
Copy link
Contributor Author

margori commented Oct 23, 2017

Bumping for a another review or definition. Thanks.

@margori
Copy link
Contributor Author

margori commented Jun 12, 2021

Bump

Copy link

@colesnic89 colesnic89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@@ -119,10 +120,6 @@ public function registerUser($performValidation = true)
$user->username = $this->username;
Copy link

@colesnic89 colesnic89 Jun 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it really necessary? the whole else block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants