Skip to content

google login#10

Open
KhaiHust wants to merge 4 commits intodevelopfrom
feature/login_fb_gg
Open

google login#10
KhaiHust wants to merge 4 commits intodevelopfrom
feature/login_fb_gg

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
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