-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure scope column of oauth_access_grants is not null
As of Doorkeeper 5.2.0.rc3, an authorization request must include a 'scope' param in case the server does not define a default scope, in line with https://tools.ietf.org/html/rfc6749#section-3.3. https://github.com/doorkeeper-gem/doorkeeper/wiki/Migration-from-old-versions#from-51x-to-52x
- Loading branch information
1 parent
73845cf
commit 411dae1
Showing
2 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
db/migrate/20200220161244_change_scope_to_not_be_null_on_oauth_access_grants.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class ChangeScopeToNotBeNullOnOauthAccessGrants < ActiveRecord::Migration[5.2] | ||
def up | ||
change_column_default :oauth_access_grants, :scopes, from: nil, to: '' | ||
change_column_null :oauth_access_grants, :scopes, false | ||
end | ||
|
||
def down | ||
change_column_default :oauth_access_grants, :scopes, from: '', to: nil | ||
change_column_null :oauth_access_grants, :scopes, true | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters