-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added visual + routing for skautis login
- Loading branch information
Lung
committed
Nov 25, 2023
1 parent
25cf76d
commit fb05681
Showing
18 changed files
with
238 additions
and
21 deletions.
There are no files selected for viewing
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace kissj\Skautis; | ||
|
||
use kissj\AbstractController; | ||
use Psr\Http\Message\ResponseInterface as Response; | ||
use Psr\Http\Message\ServerRequestInterface as Request; | ||
|
||
class SkautisController extends AbstractController | ||
{ | ||
public function __construct( | ||
) { | ||
} | ||
|
||
public function redirectFromSkautis(Request $request, Response $response): Response | ||
{ | ||
$this->flashMessages->info($this->translator->trans('flash.info.redirectedFromSkautis')); | ||
|
||
$returnLink = $this->getParameterFromQuery($request, 'ReturnUrl'); | ||
// TODO load user into session | ||
|
||
return $response | ||
->withHeader('Location', $returnLink) | ||
->withStatus(302); | ||
} | ||
} |
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,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace kissj\Skautis; | ||
|
||
use Skautis\Config; | ||
use Skautis\SessionAdapter\SessionAdapter; | ||
use Skautis\Skautis; | ||
use Skautis\User; | ||
use Skautis\Wsdl\WebServiceFactory; | ||
use Skautis\Wsdl\WsdlManager; | ||
|
||
class SkautisFactory | ||
{ | ||
public function __construct( | ||
private readonly string $appId, | ||
private readonly bool $isTestMode, | ||
) { | ||
} | ||
|
||
public function getSkautis(): Skautis | ||
{ | ||
$config = new Config($this->appId, $this->isTestMode, true, true); | ||
$wsdlManager = new WsdlManager(new WebServiceFactory(), $config); | ||
$user = new User($wsdlManager, new SessionAdapter()); | ||
|
||
return new Skautis($wsdlManager, $user); | ||
} | ||
} |
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace kissj\Skautis; | ||
|
||
class SkautisService | ||
{ | ||
public function __construct( | ||
private readonly SkautisFactory $skautisFactory, | ||
) { | ||
} | ||
|
||
public function getLoginUri(string $backlink): string | ||
{ | ||
return $this->skautisFactory->getSkautis()->getLoginUrl($backlink); | ||
} | ||
} |
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
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
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
Oops, something went wrong.