From 2dd4afbe7bc4d02f99e97ae7f94a9207b8033006 Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Sun, 14 Feb 2021 01:04:51 +0800 Subject: [PATCH] Fix github login. --- object/check.go | 10 ++++++++-- web/public/index.html | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/object/check.go b/object/check.go index 2d8bae2b..57f56336 100644 --- a/object/check.go +++ b/object/check.go @@ -1,5 +1,7 @@ package object +import "fmt" + func CheckUserRegister(userId string, password string) string { if len(userId) == 0 || len(password) == 0 { return "username and password cannot be blank" @@ -22,10 +24,14 @@ func CheckUserLogin(userId string, password string) string { return "" } +func (user *User) getId() string { + return fmt.Sprintf("%s/%s", user.Owner, user.Name) +} + func HasMail(email string) string { user := GetMail(email) if user != nil { - return user.Email + return user.getId() } return "" } @@ -33,7 +39,7 @@ func HasMail(email string) string { func HasGithub(github string) string { user := GetGithub(github) if user != nil { - return user.Github + return user.getId() } return "" } diff --git a/web/public/index.html b/web/public/index.html index 9f65892d..00b1292a 100644 --- a/web/public/index.html +++ b/web/public/index.html @@ -9,7 +9,7 @@ name="description" content="Web site created using create-react-app" /> - +