mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-22 09:54:24 +01:00
small fixes
This commit is contained in:
parent
ac82486a95
commit
3b244d673b
6
go.mod
6
go.mod
|
@ -101,6 +101,7 @@ require (
|
||||||
github.com/yuin/goldmark v1.6.0
|
github.com/yuin/goldmark v1.6.0
|
||||||
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
|
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
|
||||||
github.com/yuin/goldmark-meta v1.1.0
|
github.com/yuin/goldmark-meta v1.1.0
|
||||||
|
github.com/valyala/fastjson v1.6.4
|
||||||
golang.org/x/crypto v0.18.0
|
golang.org/x/crypto v0.18.0
|
||||||
golang.org/x/image v0.15.0
|
golang.org/x/image v0.15.0
|
||||||
golang.org/x/net v0.20.0
|
golang.org/x/net v0.20.0
|
||||||
|
@ -119,11 +120,6 @@ require (
|
||||||
xorm.io/xorm v1.3.7
|
xorm.io/xorm v1.3.7
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
|
||||||
github.com/sethvargo/go-password v0.2.0
|
|
||||||
github.com/valyala/fastjson v1.6.4
|
|
||||||
)
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go/compute v1.23.3 // indirect
|
cloud.google.com/go/compute v1.23.3 // indirect
|
||||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||||
|
|
|
@ -51,7 +51,8 @@ func CreateFederatedUser(ctx context.Context, user *User, federatedUser *Federat
|
||||||
}
|
}
|
||||||
|
|
||||||
func FindFederatedUser(ctx context.Context, externalID string,
|
func FindFederatedUser(ctx context.Context, externalID string,
|
||||||
federationHostID int64) (*User, *FederatedUser, error) {
|
federationHostID int64,
|
||||||
|
) (*User, *FederatedUser, error) {
|
||||||
federatedUser := new(FederatedUser)
|
federatedUser := new(FederatedUser)
|
||||||
user := new(User)
|
user := new(User)
|
||||||
has, err := db.GetEngine(ctx).Where("external_id=? and federation_host_id=?", externalID, federationHostID).Get(federatedUser)
|
has, err := db.GetEngine(ctx).Where("external_id=? and federation_host_id=?", externalID, federationHostID).Get(federatedUser)
|
||||||
|
|
|
@ -13,13 +13,13 @@ import (
|
||||||
"code.gitea.io/gitea/models/repo"
|
"code.gitea.io/gitea/models/repo"
|
||||||
"code.gitea.io/gitea/models/user"
|
"code.gitea.io/gitea/models/user"
|
||||||
"code.gitea.io/gitea/modules/activitypub"
|
"code.gitea.io/gitea/modules/activitypub"
|
||||||
|
"code.gitea.io/gitea/modules/auth/password"
|
||||||
"code.gitea.io/gitea/modules/context"
|
"code.gitea.io/gitea/modules/context"
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
"code.gitea.io/gitea/modules/validation"
|
"code.gitea.io/gitea/modules/validation"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
pwd_gen "github.com/sethvargo/go-password/password"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func LikeActivity(ctx *context.APIContext, form any, repositoryId int64) (error, int, string) {
|
func LikeActivity(ctx *context.APIContext, form any, repositoryId int64) (error, int, string) {
|
||||||
|
@ -165,7 +165,7 @@ func CreateUserFromAP(ctx *context.APIContext, personID forgefed.PersonID, feder
|
||||||
if len(person.Name) == 0 {
|
if len(person.Name) == 0 {
|
||||||
fullName = name
|
fullName = name
|
||||||
}
|
}
|
||||||
password, err := pwd_gen.Generate(32, 10, 10, false, true)
|
password, err := password.Generate(32)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue