Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/craft-4' into craft-5
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
#	composer.json
  • Loading branch information
engram-design committed Apr 12, 2024
2 parents 64cba99 + 3108fa1 commit e960849
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
- Now requires PHP `8.2.0+`.
- Now requires Craft `5.0.0-beta.1+`.

## 4.0.9 - 2024-04-05

### Added
- Add improved session-handling for authorization and callback methods, to improve failed sessions in some cases.

## 4.0.8 - 2023-12-08

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"require": {
"php": "^8.2",
"craftcms/cms": "^5.0.0-beta.1",
"verbb/auth": "^2.0.0-beta.1",
"verbb/auth": "^2.0.0-beta.2",
"verbb/base": "^3.0.0-beta.1"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion docs/developers/account-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ class MyAccountProvider extends OAuthAccount

This is the minimum amount of implementation required for a typical account provider.

Social Poster account provider are built around the [Auth](https://github.com/verbb/auth) which in turn in built around [league/oauth2-client](https://github.com/thephpleague/oauth2-client). You can see that the `getOAuthProviderClass()` must return a `League\OAuth2\Client\Provider\AbstractProvider` class.
Social Poster account provider are built around the [Auth](https://github.com/verbb/auth) which in turn is built around [league/oauth2-client](https://github.com/thephpleague/oauth2-client). You can see that the `getOAuthProviderClass()` must return a `League\OAuth2\Client\Provider\AbstractProvider` class.
4 changes: 4 additions & 0 deletions src/controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public function actionConnect(): ?Response

public function actionCallback(): ?Response
{

// Restore the session data that we saved before authorization redirection from the cache back to session
Session::restoreSession($this->request->getParam('state'));

// Get both the origin (failure) and redirect (success) URLs
$origin = Session::get('origin');
$redirect = Session::get('redirect');
Expand Down
2 changes: 0 additions & 2 deletions src/migrations/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class Install extends Migration
public function safeUp(): bool
{
// Ensure that the Auth module kicks off setting up tables
// Use `Auth::getInstance()` not `Auth::$plugin` as it doesn't seem to work well in migrations
Auth::getInstance()->migrator->up();

$this->createTables();
Expand All @@ -30,7 +29,6 @@ public function safeDown(): bool
$this->dropTables();

// Delete all tokens for this plugin
// Use `Auth::getInstance()` not `Auth::$plugin` as it doesn't seem to work well in migrations
Auth::getInstance()->getTokens()->deleteTokensByOwner('social-poster');

return true;
Expand Down

0 comments on commit e960849

Please sign in to comment.