mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Fix github login.
This commit is contained in:
parent
101d418257
commit
2dd4afbe7b
@ -1,5 +1,7 @@
|
|||||||
package object
|
package object
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
func CheckUserRegister(userId string, password string) string {
|
func CheckUserRegister(userId string, password string) string {
|
||||||
if len(userId) == 0 || len(password) == 0 {
|
if len(userId) == 0 || len(password) == 0 {
|
||||||
return "username and password cannot be blank"
|
return "username and password cannot be blank"
|
||||||
@ -22,10 +24,14 @@ func CheckUserLogin(userId string, password string) string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (user *User) getId() string {
|
||||||
|
return fmt.Sprintf("%s/%s", user.Owner, user.Name)
|
||||||
|
}
|
||||||
|
|
||||||
func HasMail(email string) string {
|
func HasMail(email string) string {
|
||||||
user := GetMail(email)
|
user := GetMail(email)
|
||||||
if user != nil {
|
if user != nil {
|
||||||
return user.Email
|
return user.getId()
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
@ -33,7 +39,7 @@ func HasMail(email string) string {
|
|||||||
func HasGithub(github string) string {
|
func HasGithub(github string) string {
|
||||||
user := GetGithub(github)
|
user := GetGithub(github)
|
||||||
if user != nil {
|
if user != nil {
|
||||||
return user.Github
|
return user.getId()
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
name="description"
|
name="description"
|
||||||
content="Web site created using create-react-app"
|
content="Web site created using create-react-app"
|
||||||
/>
|
/>
|
||||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/favicon.png" />
|
||||||
<!--
|
<!--
|
||||||
manifest.json provides metadata used when your web app is installed on a
|
manifest.json provides metadata used when your web app is installed on a
|
||||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user