-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: develop
Are you sure you want to change the base?
google login #10
Conversation
c.Redirect(http.StatusFound, url) | ||
} | ||
|
||
func (b *AuthController) GoogleCallback(c *gin.Context) { |
There was a problem hiding this comment.
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"` |
There was a problem hiding this comment.
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
No description provided.