summaryrefslogtreecommitdiffstats
path: root/store
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2018-02-07 16:21:22 -0500
committerJoramWilander <jwawilander@gmail.com>2018-02-07 16:21:22 -0500
commit840892ab887680935df516f6942eb3563b7bf96b (patch)
treef8a9f4593b705fe18d84862017464cad23aa02cb /store
parent654fc2f7494889f00c236ec3eac8d37a887b1804 (diff)
downloadchat-840892ab887680935df516f6942eb3563b7bf96b.tar.gz
chat-840892ab887680935df516f6942eb3563b7bf96b.tar.bz2
chat-840892ab887680935df516f6942eb3563b7bf96b.zip
Increase OAuth2 state parameter limit
Diffstat (limited to 'store')
-rw-r--r--store/sqlstore/oauth_store.go2
-rw-r--r--store/sqlstore/upgrade.go1
2 files changed, 2 insertions, 1 deletions
diff --git a/store/sqlstore/oauth_store.go b/store/sqlstore/oauth_store.go
index 30a44b75f..0a9bd8266 100644
--- a/store/sqlstore/oauth_store.go
+++ b/store/sqlstore/oauth_store.go
@@ -35,7 +35,7 @@ func NewSqlOAuthStore(sqlStore SqlStore) store.OAuthStore {
tableAuth.ColMap("ClientId").SetMaxSize(26)
tableAuth.ColMap("Code").SetMaxSize(128)
tableAuth.ColMap("RedirectUri").SetMaxSize(256)
- tableAuth.ColMap("State").SetMaxSize(128)
+ tableAuth.ColMap("State").SetMaxSize(1024)
tableAuth.ColMap("Scope").SetMaxSize(128)
tableAccess := db.AddTableWithName(model.AccessData{}, "OAuthAccessData").SetKeys(false, "Token")
diff --git a/store/sqlstore/upgrade.go b/store/sqlstore/upgrade.go
index 0de91f28b..7c1522f25 100644
--- a/store/sqlstore/upgrade.go
+++ b/store/sqlstore/upgrade.go
@@ -343,6 +343,7 @@ func UpgradeDatabaseToVersion46(sqlStore SqlStore) {
func UpgradeDatabaseToVersion47(sqlStore SqlStore) {
if shouldPerformUpgrade(sqlStore, VERSION_4_6_0, VERSION_4_7_0) {
sqlStore.AlterColumnTypeIfExists("Users", "Position", "varchar(128)", "varchar(128)")
+ sqlStore.AlterColumnTypeIfExists("OAuthAuthData", "State", "varchar(1024)", "varchar(1024)")
saveSchemaVersion(sqlStore, VERSION_4_7_0)
}
}