mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-24 08:20:31 +08:00
Fix properties in "sign up via OAuth".
This commit is contained in:
parent
8ddc0cd626
commit
c4de5449af
@ -17,6 +17,7 @@ package controllers
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
@ -246,6 +247,8 @@ func (c *ApiController) Login() {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
// sign up via OAuth
|
// sign up via OAuth
|
||||||
|
properties := map[string]string{}
|
||||||
|
properties["no"] = strconv.Itoa(len(object.GetUsers(application.Organization)) + 2)
|
||||||
if provider.EnableSignUp {
|
if provider.EnableSignUp {
|
||||||
user := &object.User{
|
user := &object.User{
|
||||||
Owner: application.Organization,
|
Owner: application.Organization,
|
||||||
@ -256,10 +259,11 @@ func (c *ApiController) Login() {
|
|||||||
DisplayName: userInfo.DisplayName,
|
DisplayName: userInfo.DisplayName,
|
||||||
Avatar: userInfo.AvatarUrl,
|
Avatar: userInfo.AvatarUrl,
|
||||||
Email: userInfo.Email,
|
Email: userInfo.Email,
|
||||||
|
Score: 200,
|
||||||
IsAdmin: false,
|
IsAdmin: false,
|
||||||
IsGlobalAdmin: false,
|
IsGlobalAdmin: false,
|
||||||
IsForbidden: false,
|
IsForbidden: false,
|
||||||
Properties: map[string]string{},
|
Properties: properties,
|
||||||
}
|
}
|
||||||
object.AddUser(user)
|
object.AddUser(user)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user