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

google login #10

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

google login #10

wants to merge 4 commits into from

Conversation

KhaiHust
Copy link
Collaborator

@KhaiHust KhaiHust commented Sep 6, 2023

No description provided.

c.Redirect(http.StatusFound, url)
}

func (b *AuthController) GoogleCallback(c *gin.Context) {
Copy link

Choose a reason for hiding this comment

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

callback thường thêm param state để validate request này

models/user.go Outdated
@@ -4,9 +4,9 @@ type User struct {
BaseModel
FirstName string `json:"first_name" gorm:"column:first_name;type:varchar(50);not null"`
LastName string `json:"last_name" gorm:"column:last_name;type:varchar(50);not null"`
Email string `json:"email" gorm:"column:email;type:varchar(100);not null"`
Email string `json:"email" gorm:"column:email;type:varchar(100);not null; unique"`
Copy link
Contributor

Choose a reason for hiding this comment

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

cái email khi login thường, fb, google nó sẽ bị trùng email này. Trước team PO chốt là nếu đăng nhập bằng các phương thức khác nhau thì sẽ tạo ra 3 tài khoản khác nhau, nên mình sẽ không index unique ở chỉ email mà mình sẽ đánh index composite unique 2 column email vs social luôn

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