Skip to content

Commit

Permalink
Version 3.0.4.1 - fix crash when no Two Factor Authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
marionnewlevant committed Dec 24, 2020
1 parent ef0d746 commit 306bcd6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 3.0.4.1 - 2020.12.24
### Fixed
- Snitch should again work without Two Factor Authentication

## 3.0.4 - 2020.12.23
### Fixed
- Fixed problem with Snitch interfering with Two Factor Authentication
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "marionnewlevant/snitch",
"description": "Report when two people might be editing the same element (eg entry, category, or global) or field",
"type": "craft-plugin",
"version": "3.0.4",
"version": "3.0.4.1",
"keywords": [
"craft",
"cms",
Expand Down
8 changes: 3 additions & 5 deletions src/Snitch.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
use craft\base\Plugin;
use yii\base\Event;

use born05\twofactorauthentication\Plugin as TwoFactorAuth;


/**
* Craft plugins are very much like little applications in and of themselves. We’ve made
Expand Down Expand Up @@ -101,9 +99,9 @@ public function init()
Event::on(Plugins::class, Plugins::EVENT_AFTER_LOAD_PLUGINS, function () {
$user = Craft::$app->getUser();
// TwoFactorAuth - either not there, or not turned on for this user, or we have passed that hurdle
if (!TwoFactorAuth::$plugin
|| !TwoFactorAuth::$plugin->verify->isEnabled($user->getIdentity())
|| TwoFactorAuth::$plugin->verify->isVerified($user->getIdentity())
if (!Craft::$app->plugins->isPluginInstalled('two-factor-authentication')
|| !\born05\twofactorauthentication\Plugin::$plugin->verify->isEnabled($user->getIdentity())
|| \born05\twofactorauthentication\Plugin::$plugin->verify->isVerified($user->getIdentity())
)
{
// Register our asset bundle
Expand Down

0 comments on commit 306bcd6

Please sign in to comment.