1
0
Fork 0
forked from forgejo/forgejo

migrate from com.* to alternatives (#14103)

* remove github.com/unknwon/com from models

* dont use "com.ToStr()"

* replace "com.ToStr" with "fmt.Sprint" where its easy to do

* more refactor

* fix test

* just "proxy" Copy func for now

* as per @lunny
This commit is contained in:
6543 2020-12-25 09:59:32 +00:00 committed by GitHub
parent 04ae0f2f3f
commit a19447aed1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 230 additions and 220 deletions

View file

@ -14,10 +14,10 @@ import (
"code.gitea.io/gitea/modules/secret"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
"github.com/dgrijalva/jwt-go"
uuid "github.com/google/uuid"
"github.com/unknwon/com"
"golang.org/x/crypto/bcrypt"
"xorm.io/xorm"
)
@ -62,7 +62,7 @@ func (app *OAuth2Application) LoadUser() (err error) {
// ContainsRedirectURI checks if redirectURI is allowed for app
func (app *OAuth2Application) ContainsRedirectURI(redirectURI string) bool {
return com.IsSliceContainsStr(app.RedirectURIs, redirectURI)
return util.IsStringInSlice(redirectURI, app.RedirectURIs, true)
}
// GenerateClientSecret will generate the client secret and returns the plaintext and saves the hash at the database