Spaces:
Runtime error
Runtime error
Commit ·
7fc7e09
1
Parent(s): ce2e95f
Deploy files from GitHub repository
Browse files
models/database_orm_model.go
CHANGED
|
@@ -12,7 +12,7 @@ type Account struct {
|
|
| 12 |
Username string `gorm:"uniqueIndex" json:"username"`
|
| 13 |
Email string `gorm:"uniqueIndex" json:"email"`
|
| 14 |
Role string `json:"role"`
|
| 15 |
-
Password string `json:"
|
| 16 |
IsEmailVerified bool `json:"is_email_verified"`
|
| 17 |
IsDetailCompleted bool `json:"is_detail_completed"`
|
| 18 |
CreatedAt time.Time `json:"created_at"`
|
|
|
|
| 12 |
Username string `gorm:"uniqueIndex" json:"username"`
|
| 13 |
Email string `gorm:"uniqueIndex" json:"email"`
|
| 14 |
Role string `json:"role"`
|
| 15 |
+
Password string `json:"-"`
|
| 16 |
IsEmailVerified bool `json:"is_email_verified"`
|
| 17 |
IsDetailCompleted bool `json:"is_detail_completed"`
|
| 18 |
CreatedAt time.Time `json:"created_at"`
|
services/external_authentication_service.go
CHANGED
|
@@ -4,6 +4,7 @@ import (
|
|
| 4 |
"context"
|
| 5 |
"errors"
|
| 6 |
|
|
|
|
| 7 |
"godp.abdanhafidz.com/models"
|
| 8 |
"godp.abdanhafidz.com/repositories"
|
| 9 |
"google.golang.org/api/idtoken"
|
|
@@ -42,6 +43,7 @@ func (s *GoogleAuthService) Authenticate(isAgree bool) {
|
|
| 42 |
s.Constructor.OauthProvider = "Google"
|
| 43 |
|
| 44 |
createAccount := repositories.CreateAccount(models.Account{
|
|
|
|
| 45 |
Email: email.(string),
|
| 46 |
IsEmailVerified: true,
|
| 47 |
})
|
|
|
|
| 4 |
"context"
|
| 5 |
"errors"
|
| 6 |
|
| 7 |
+
"github.com/google/uuid"
|
| 8 |
"godp.abdanhafidz.com/models"
|
| 9 |
"godp.abdanhafidz.com/repositories"
|
| 10 |
"google.golang.org/api/idtoken"
|
|
|
|
| 43 |
s.Constructor.OauthProvider = "Google"
|
| 44 |
|
| 45 |
createAccount := repositories.CreateAccount(models.Account{
|
| 46 |
+
Id: uuid.New(),
|
| 47 |
Email: email.(string),
|
| 48 |
IsEmailVerified: true,
|
| 49 |
})
|
utils/Logger.go
CHANGED
|
@@ -6,6 +6,5 @@ import (
|
|
| 6 |
|
| 7 |
func LogError(errorLogged error) {
|
| 8 |
fmt.Println("There is an error!")
|
| 9 |
-
fmt.Println("Error
|
| 10 |
-
|
| 11 |
}
|
|
|
|
| 6 |
|
| 7 |
func LogError(errorLogged error) {
|
| 8 |
fmt.Println("There is an error!")
|
| 9 |
+
fmt.Println("Error:", errorLogged)
|
|
|
|
| 10 |
}
|