2525use OCP \Authentication \Exceptions \ExpiredTokenException ;
2626use OCP \Authentication \Exceptions \InvalidTokenException ;
2727use OCP \DB \Exception ;
28+ use OCP \GlobalScale \IConfig as GlobalScaleConfig ;
2829use OCP \IDBConnection ;
2930use OCP \IRequest ;
3031use OCP \Security \Bruteforce \IThrottler ;
@@ -40,16 +41,17 @@ class OauthApiController extends Controller {
4041 public function __construct (
4142 string $ appName ,
4243 IRequest $ request ,
43- private ICrypto $ crypto ,
44- private AccessTokenMapper $ accessTokenMapper ,
45- private ClientMapper $ clientMapper ,
46- private TokenProvider $ tokenProvider ,
47- private ISecureRandom $ secureRandom ,
48- private ITimeFactory $ time ,
49- private LoggerInterface $ logger ,
50- private IThrottler $ throttler ,
51- private ITimeFactory $ timeFactory ,
52- private IDBConnection $ db ,
44+ private readonly ICrypto $ crypto ,
45+ private readonly AccessTokenMapper $ accessTokenMapper ,
46+ private readonly ClientMapper $ clientMapper ,
47+ private readonly TokenProvider $ tokenProvider ,
48+ private readonly ISecureRandom $ secureRandom ,
49+ private readonly ITimeFactory $ time ,
50+ private readonly LoggerInterface $ logger ,
51+ private readonly IThrottler $ throttler ,
52+ private readonly ITimeFactory $ timeFactory ,
53+ private readonly IDBConnection $ db ,
54+ private readonly GlobalScaleConfig $ globalScaleConfig ,
5355 ) {
5456 parent ::__construct ($ appName , $ request );
5557 }
@@ -229,6 +231,11 @@ public function getToken(
229231
230232 $ this ->throttler ->resetDelay ($ this ->request ->getRemoteAddress (), 'login ' , ['user ' => $ appToken ->getUID ()]);
231233
234+ if ($ this ->globalScaleConfig ->isGlobalScaleEnabled () && $ this ->globalScaleConfig ->isPrimary ()) {
235+ // Also make sure the access token is available on the secondary instance
236+
237+ }
238+
232239 return new JSONResponse (
233240 [
234241 'access_token ' => $ newToken ,
0 commit comments