summaryrefslogtreecommitdiffstats
path: root/models/oauth2_application.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-12-25 09:59:32 +0000
committerGitHub <noreply@github.com>2020-12-25 11:59:32 +0200
commita19447aed128ecadfcd938d6a80cd4951af1f4ce (patch)
tree6312bf946d601aab29731645a4777feeaea66036 /models/oauth2_application.go
parent04ae0f2f3f4556c6d0b4adc5f2cffd0cc7d25151 (diff)
downloadgitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.tar.gz
gitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.zip
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
Diffstat (limited to 'models/oauth2_application.go')
-rw-r--r--models/oauth2_application.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/oauth2_application.go b/models/oauth2_application.go
index 1c7937685c..af4d280d0c 100644
--- a/models/oauth2_application.go
+++ b/models/oauth2_application.go
@@ -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