@@ -40,9 +40,6 @@ class MarketController extends Controller {
4040 /** @var IL10N */
4141 private $ l10n ;
4242
43- /** @var IURLGenerator */
44- private $ urlGenerator ;
45-
4643 /** @var IConfig */
4744 private $ config ;
4845
@@ -51,13 +48,11 @@ public function __construct(
5148 IRequest $ request ,
5249 MarketService $ marketService ,
5350 IL10N $ l10n ,
54- IURLGenerator $ urlGenerator ,
5551 IConfig $ config
5652 ) {
5753 parent ::__construct ($ appName , $ request );
5854 $ this ->marketService = $ marketService ;
5955 $ this ->l10n = $ l10n ;
60- $ this ->urlGenerator = $ urlGenerator ;
6156 $ this ->config = $ config ;
6257 }
6358
@@ -358,47 +353,6 @@ public function requestDemoLicenseKeyFromMarket() {
358353 }
359354 }
360355
361- /**
362- * @NoCSRFRequired
363- */
364- public function startMarketplaceLogin () {
365- $ codeChallenge = $ this ->marketService ->startMarketplaceLogin ();
366- $ callbackUrl = $ this ->urlGenerator ->linkToRouteAbsolute ('market.page.indexHash ' );
367- $ appStoreUrl = $ this ->config ->getSystemValue ('appstoreurl ' , 'https://marketplace.owncloud.com ' );
368-
369- return new DataResponse ([
370- 'loginUrl ' => "$ appStoreUrl/login?callbackUrl= $ callbackUrl&codeChallenge= $ codeChallenge "
371- ]);
372- }
373-
374- /**
375- * Redirect from marketplace with login-token in the query
376- *
377- * @NoCSRFRequired
378- *
379- * @param string $token
380- * @return DataResponse
381- */
382- public function receiveMarketplaceLoginToken ($ token ) {
383- if (!$ token ) {
384- return new DataResponse ([
385- 'message ' => $ this ->l10n ->t ('Token is missing ' )
386- ], Http::STATUS_BAD_REQUEST );
387- }
388-
389- try {
390- $ apiKey = $ this ->marketService ->loginViaMarketplace ($ token );
391- } catch (\Exception $ ex ) {
392- return new DataResponse (
393- [
394- 'message ' => $ this ->l10n ->t ('Could not login via marketplace ' )],
395- Http::STATUS_UNAUTHORIZED
396- );
397- }
398-
399- return new DataResponse (['apiKey ' => $ apiKey ]);
400- }
401-
402356 public function invalidateCache () {
403357 $ this ->marketService ->invalidateCache ();
404358 return new DataResponse (
0 commit comments