File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,12 @@ class AuthorizationView(BaseAuthorizationView, FormView):
78
78
skip_authorization_completely = False
79
79
80
80
def get_initial (self ):
81
- # TODO: move this scopes conversion from and to string into a utils function
82
- scopes = self .oauth2_data .get ('scope' , self .oauth2_data .get ('scopes' , []))
81
+ if oauth2_settings .APP_SPECIFIC_SCOPES :
82
+ application = Application .objects .get (client_id = self .request .GET ['client_id' ])
83
+ scopes = application .allowed_scopes .split (' ' )
84
+ else :
85
+ # TODO: move this scopes conversion from and to string into a utils function
86
+ scopes = self .oauth2_data .get ('scope' , self .oauth2_data .get ('scopes' , []))
83
87
initial_data = {
84
88
'redirect_uri' : self .oauth2_data .get ('redirect_uri' , None ),
85
89
'scope' : ' ' .join (scopes ),
You can’t perform that action at this time.
0 commit comments