diff --git a/package.json b/package.json index e6fb1d9..07a525c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "devDependencies": { "autoprefixer": "^10.2.6", - "axios": "^0.21.1", + "axios": "^1.6.3", "browser-sync": "^2.26.14", "browser-sync-webpack-plugin": "^2.3.0", "cross-env": "^7.0.3", diff --git a/resources/lang/de/cp.php b/resources/lang/de/cp.php index fae9e91..4e47ab2 100644 --- a/resources/lang/de/cp.php +++ b/resources/lang/de/cp.php @@ -4,17 +4,17 @@ return [ 'settings' => [ - 'headline' => 'MagicLink', - 'configure_your_needs' => 'Passe MagicLink nach deinen Wünschen an', - 'ml_enabled' => 'MagicLink aktivieren?', - 'ml_enabled_instructions' => 'Aktiviere oder deaktiviere die Nutzung von MagicLinks', - 'ml_expire_time' => 'Ablaufzeit', + 'headline' => 'MagicLink', + 'configure_your_needs' => 'Passe MagicLink nach deinen Wünschen an', + 'ml_enabled' => 'MagicLink aktivieren?', + 'ml_enabled_instructions' => 'Aktiviere oder deaktiviere die Nutzung von MagicLinks', + 'ml_expire_time' => 'Ablaufzeit', 'ml_expire_time_instructions' => 'Laufzeit des Links, nachdem er verfällt. Standard sind 30 Minuten.', - 'updated_successfully' => 'Einstellungen erfolgreich aktualisiert.', + 'updated_successfully' => 'Einstellungen erfolgreich aktualisiert.', ], 'permissions' => [ - 'settings' => 'MagicLink Einstellung', - 'view_settings' => 'Einstellungen ansehen', + 'settings' => 'MagicLink Einstellung', + 'view_settings' => 'Einstellungen ansehen', 'view_settings_description' => 'Zugriff, um Einstellungen anzusehen.', ], 'email' => [ diff --git a/resources/lang/de/web.php b/resources/lang/de/web.php index 6547567..26c87d9 100644 --- a/resources/lang/de/web.php +++ b/resources/lang/de/web.php @@ -3,10 +3,10 @@ declare(strict_types=1); return [ - 'address_exists_then_email' => 'Wenn die E-Mail-Adresse bei uns registriert ist, solltest du eine E-Mail bekommen haben.', - 'back_to_classic_login' => 'Zurück zum klassischen Login?', - 'email_address' => 'E-Mail-Adresse', - 'login_magic_link' => 'Magic Link senden', + 'address_exists_then_email' => 'Wenn die E-Mail-Adresse bei uns registriert ist, solltest du eine E-Mail bekommen haben.', + 'back_to_classic_login' => 'Zurück zum klassischen Login?', + 'email_address' => 'E-Mail-Adresse', + 'login_magic_link' => 'Magic Link senden', 'magic_link_signature_invalid' => 'Der Magic Link ist ungültig. Bitte fordere einen neuen Link an.', - 'unable_to_send' => 'Senden des Links nicht möglich.', + 'unable_to_send' => 'Senden des Links nicht möglich.', ]; diff --git a/resources/lang/en/cp.php b/resources/lang/en/cp.php index 9bef464..f57ba94 100644 --- a/resources/lang/en/cp.php +++ b/resources/lang/en/cp.php @@ -11,24 +11,24 @@ 'redirect_to' => 'Redirect to', ], 'settings' => [ - 'headline' => 'MagicLink', - 'configure_your_needs' => 'Configure MagicLink after your needs.', - 'ml_enabled' => 'MagicLink enabled?', - 'ml_enabled_instructions' => 'Activate or deactivate the usage of magic links.', - 'ml_expire_time' => 'Expire time', + 'headline' => 'MagicLink', + 'configure_your_needs' => 'Configure MagicLink after your needs.', + 'ml_enabled' => 'MagicLink enabled?', + 'ml_enabled_instructions' => 'Activate or deactivate the usage of magic links.', + 'ml_expire_time' => 'Expire time', 'ml_expire_time_instructions' => 'Time the login link is valid. Default is 30 minutes.', 'ml_allowed_addresses' => 'Allowed addresses', 'ml_allowed_addresses_instructions' => 'Allowed addresses to request a magic link for viewing protected content. Enter one address in each field.', 'ml_allowed_domains' => 'Allowed domains', 'ml_allowed_domains_instructions' => 'Allowed domains to request a magic link for. _Example:_ example.com', - 'settings' => 'Settings', - 'updated_successfully' => 'Settings updated successfully.', + 'settings' => 'Settings', + 'updated_successfully' => 'Settings updated successfully.', ], 'permissions' => [ - 'settings' => 'MagicLink Settings', - 'view_links' => 'View links', - 'view_links_description' => 'Grants access to see magic links', - 'view_settings' => 'View settings', + 'settings' => 'MagicLink Settings', + 'view_links' => 'View links', + 'view_links_description' => 'Grants access to see magic links', + 'view_settings' => 'View settings', 'view_settings_description' => 'Grants access to see settings', ], 'email' => [ diff --git a/resources/lang/en/web.php b/resources/lang/en/web.php index 761b5ce..9638812 100644 --- a/resources/lang/en/web.php +++ b/resources/lang/en/web.php @@ -3,10 +3,10 @@ declare(strict_types=1); return [ - 'address_exists_then_email' => 'If there exists an account with this email address, you should have received a message.', - 'back_to_classic_login' => 'Back to classic login page?', - 'email_address' => 'Email', - 'login_magic_link' => 'Send Magic Link', + 'address_exists_then_email' => 'If there exists an account with this email address, you should have received a message.', + 'back_to_classic_login' => 'Back to classic login page?', + 'email_address' => 'Email', + 'login_magic_link' => 'Send Magic Link', 'magic_link_signature_invalid' => 'Your MagicLink signature seems invalid. Please request a new link.', - 'unable_to_send' => 'Unable to send link.', + 'unable_to_send' => 'Unable to send link.', ]; diff --git a/src/Http/Controllers/Cp/Auth/LoginController.php b/src/Http/Controllers/Cp/Auth/LoginController.php index 1eb8fcf..1ebb552 100644 --- a/src/Http/Controllers/Cp/Auth/LoginController.php +++ b/src/Http/Controllers/Cp/Auth/LoginController.php @@ -27,11 +27,11 @@ public function showLoginForm(Request $request) } $data = [ - 'title' => __('Log in'), - 'oauth' => $enabled = OAuth::enabled(), + 'title' => __('Log in'), + 'oauth' => $enabled = OAuth::enabled(), 'providers' => $enabled ? OAuth::providers() : [], - 'referer' => $this->getReferrer(), - 'hasError' => $this->hasError(), + 'referer' => $this->getReferrer(), + 'hasError' => $this->hasError(), ]; $view = view('magiclink::auth.login', $data); diff --git a/src/Http/Controllers/Cp/SettingsController.php b/src/Http/Controllers/Cp/SettingsController.php index 8f878ca..40083b9 100644 --- a/src/Http/Controllers/Cp/SettingsController.php +++ b/src/Http/Controllers/Cp/SettingsController.php @@ -30,7 +30,7 @@ public function update(Request $request) $this->authorize('view magiclink settings'); $request->validate([ - 'enabled' => ['required', 'boolean'], + 'enabled' => ['required', 'boolean'], 'expireTime' => ['required', 'numeric'], 'allowedAddresses' => ['present', 'array'], 'allowedAddresses.*' => ['sometimes', 'email'], diff --git a/src/MagicLink.php b/src/MagicLink.php index 3417742..416ec56 100644 --- a/src/MagicLink.php +++ b/src/MagicLink.php @@ -71,7 +71,7 @@ public function generate(): self 'magiclink.login', $this->expireTime, [ - 'hash' => $this->generateHash(), + 'hash' => $this->generateHash(), 'user_email' => $this->user->email(), ] ); diff --git a/src/MagicLinkManager.php b/src/MagicLinkManager.php index 913b428..d0952af 100644 --- a/src/MagicLinkManager.php +++ b/src/MagicLinkManager.php @@ -45,9 +45,9 @@ public function generate(): MagicLink $link = $this->magicLink->generate(); $payload[$this->user->email()] = [ - 'email' => $this->user->email(), + 'email' => $this->user->email(), 'expire_time' => $this->magicLink->getExpireTime()->timestamp, - 'hash' => $link->getHash(), + 'hash' => $link->getHash(), 'redirect_to' => $this->magicLink->getRedirectTo(), ]; diff --git a/src/Mail/MagicLink/LinkInformation.php b/src/Mail/MagicLink/LinkInformation.php index 30555a5..7a87047 100644 --- a/src/Mail/MagicLink/LinkInformation.php +++ b/src/Mail/MagicLink/LinkInformation.php @@ -24,7 +24,7 @@ public function build() { return $this->subject(config('app.name').' - '.__('magiclink::cp.email.new_link_subject')) ->markdown('magiclink::emails.new-login-link', [ - 'userName' => $this->user->name, + 'userName' => $this->user->name, 'magicLink' => $this->magicLink->getLink(), ]); } diff --git a/src/Repositories/SettingsRepository.php b/src/Repositories/SettingsRepository.php index b35f318..bd60017 100644 --- a/src/Repositories/SettingsRepository.php +++ b/src/Repositories/SettingsRepository.php @@ -26,7 +26,7 @@ public function __construct(Filesystem $files) $this->path = storage_path('statamic-magiclink/settings.yaml'); $this->defaultValues = [ - self::IS_ENABLED_KEY => false, + self::IS_ENABLED_KEY => false, self::EXPIRE_TIME_KEY => config('statamic-magiclink.expire_time'), self::ALLOWED_ADDRESSES => [], self::ALLOWED_DOMAINS => [], diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index da5d8a7..8554242 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -17,7 +17,7 @@ final class ServiceProvider extends AddonServiceProvider { protected $routes = [ - 'cp' => __DIR__.'/../routes/cp.php', + 'cp' => __DIR__.'/../routes/cp.php', 'web' => __DIR__.'/../routes/web.php', ]; diff --git a/tests/CP/Settings/SettingsTest.php b/tests/CP/Settings/SettingsTest.php index 8d8e7da..9497e13 100644 --- a/tests/CP/Settings/SettingsTest.php +++ b/tests/CP/Settings/SettingsTest.php @@ -36,7 +36,7 @@ public function cannot_see_settings_with_no_permissions(): void public function can_update_settings_without_error(): void { $payload = [ - 'enabled' => true, + 'enabled' => true, 'expireTime' => 999, 'allowedAddresses' => [], 'allowedDomains' => [], @@ -52,7 +52,7 @@ public function can_update_settings_without_error(): void public function cannot_update_settings_with_all_errors(): void { $payload = [ - 'enabled' => 123, + 'enabled' => 123, 'expireTime' => 'test', 'allowedAddresses' => ['wrong'], 'allowedDomains' => [], @@ -67,7 +67,7 @@ public function cannot_update_settings_with_all_errors(): void public function cannot_update_settings_with_enabled_errors(): void { $payload = [ - 'enabled' => 123, + 'enabled' => 123, 'expireTime' => 30, 'allowedAddresses' => [], 'allowedDomains' => [], @@ -88,7 +88,7 @@ public function cannot_update_settings_with_enabled_errors(): void public function cannot_update_settings_with_expire_time_errors(): void { $payload = [ - 'enabled' => true, + 'enabled' => true, 'expireTime' => 'test', 'allowedAddresses' => [], 'allowedDomains' => [], @@ -111,7 +111,7 @@ public function can_set_enabled_to_true_false(): void $repository = $this->app->make(SettingsRepository::class); $payload = [ - 'enabled' => true, + 'enabled' => true, 'expireTime' => 300, 'allowedAddresses' => [], 'allowedDomains' => [], @@ -121,7 +121,7 @@ public function can_set_enabled_to_true_false(): void $this->assertTrue($repository->isEnabled()); $payload = [ - 'enabled' => false, + 'enabled' => false, 'expireTime' => 300, 'allowedAddresses' => [], 'allowedDomains' => [], @@ -137,7 +137,7 @@ public function can_set_expireTime_to_values(): void $repository = $this->app->make(SettingsRepository::class); $payload = [ - 'enabled' => true, + 'enabled' => true, 'expireTime' => 300, 'allowedAddresses' => [], 'allowedDomains' => [], diff --git a/tests/MagicLink/MagicLinkFormTest.php b/tests/MagicLink/MagicLinkFormTest.php index 2d01b8b..4d39a96 100644 --- a/tests/MagicLink/MagicLinkFormTest.php +++ b/tests/MagicLink/MagicLinkFormTest.php @@ -46,7 +46,7 @@ public function can_request_link_for_non_existing_but_allowed_domain_user(): voi $this->signInAdmin(); $payload = [ - 'enabled' => true, + 'enabled' => true, 'expireTime' => 999, 'allowedAddresses' => [], 'allowedDomains' => ['larifari.test'], diff --git a/tests/TestCase.php b/tests/TestCase.php index e11ce08..108b6f3 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -101,7 +101,7 @@ protected function getEnvironmentSetUp($app) $app->make(Manifest::class)->manifest = [ 'codedge/statamic-magiclink' => [ - 'id' => 'codedge/statamic-magiclink', + 'id' => 'codedge/statamic-magiclink', 'namespace' => 'Codedge\\MagicLink\\', ], ];