Coder Social home page Coder Social logo

kind-work / login-notify Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 911 KB

Login notifications for new logins for Statamic V3

Home Page: https://statamic.com/marketplace/addons/login-notify

License: Other

PHP 46.06% Vue 10.07% JavaScript 2.83% Blade 40.97% SCSS 0.08%
statamic-v3 statamic-addon notify login addon control-panel

login-notify's Introduction

This addon is no longer supported.

Login Notify for Statamic 3

Statamic 3.0+ Commercial License Codacy Badge

Statamic Login Notify is an addon for Statamic 3 that sends email notifications when a user logs into a new device.

Requirements

  • PHP 7.2+
  • Statamic v3+
  • Laravel 7+

Installation

Install the addon using composer

composer require kind-work/login-notify

Location Map

If you would like to send a map showing the location of the login in the email you will need to provide a valid key for the Google Maps Static API. I recommend you restrict this by IP address(es) to the IP(s) used by your servers.

Once you obtain this key add it to your environment variable: GOOGLE_MAPS_KEY

Location Lookup

Location lookup is done using the Laravel Location package. Refer to the documentation for this package to customize the location lookups.

Fieldtype (forget sessions)

If you would like to give users the ability to forget browsers where they have previously logged in you can add the Login Notify field type to the user blueprint with the key login_notify_valid_cookies.

title: User
sections:
  main:
    display: Main
    fields:
      ...
      -
        handle: login_notify_valid_cookies
        field:
          type: login_notify
          localizable: false
          display: 'Remembered Browsers'

Changelog

Please see the Release Notes for more information what has changed recently.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

License

This is commercial software. You may use the package for your sites. Each site requires its own license. You can purchase a licence from The Statamic Marketplace.

login-notify's People

Contributors

jcohlmeyer avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

codacy-badger

login-notify's Issues

Unable to install on Laravel 9

Hi,

I'm getting the following:

composer require kind-work/login-notify
./composer.json has been updated
Running composer update kind-work/login-notify
> Statamic\Console\Composer\Scripts::preUpdateCmd
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - stevebauman/location v5.0.1 requires illuminate/support ~5.0|~6.0 -> found illuminate/support[v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev] but these were not loaded, likely because it conflicts with another require.
    - stevebauman/location[v5.0.2, ..., v5.1.0] require illuminate/support ~5.0|~6.0|~7.0 -> found illuminate/support[v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev] but these were not loaded, likely because it conflicts with another require.
    - stevebauman/location v5.2.0 requires illuminate/support ~5.0|~6.0|~7.0|~8.0 -> found illuminate/support[v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
    - kind-work/login-notify[dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2, ..., dev-master, v1.0.0-beta.1, ..., v1.1.0] require stevebauman/location ^5.0.1 -> satisfiable by stevebauman/location[v5.0.1, v5.0.2, v5.1.0, v5.2.0].
    - Root composer.json requires kind-work/login-notify * -> satisfiable by kind-work/login-notify[dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2, ..., dev-master, v1.0.0-beta.1, ..., v1.1.0, 9999999-dev].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require kind-work/login-notify:*" to figure out if any version is installable, or "composer require kind-work/login-notify:^2.1" if you know which you need.

I'm not great with composer issues but I think this means there is a conflict with a package this plug in uses?

Not showing sessions to forget

Thanks for creating this plug in.

One issue I'm having:

I've added the login_notify field to users:

sections:
  main:
    display: Main
    fields:
      -
        handle: name
        field:
          type: text
          display: Name
      -
        handle: email
        field:
          type: text
          input_type: email
          display: 'Email Address'
      -
        handle: roles
        field:
          type: user_roles
          mode: select
          width: 50
      -
        handle: groups
        field:
          type: user_groups
          mode: select
          width: 50
      -
        handle: login_notify
        field:
          display: 'Remembered Browsers'
          type: login_notify
          icon: login_notify
          listable: hidden
          instructions_position: above

Which is displaying:

image

However I'm not seeing any browsers.

Here's the relavent section from my user yaml:

name: 'Robert Cooper'
login_notify_valid_cookies:
  Rj0GgesruRzucyG1uGyNfQhxh6bgraFC:
    browser: Chrome
    os: 'Windows 10'
    ip: -- removed --
    at: 'Mon, Jan 17, 2022 8:58 PM'
  BvODVutvq2Cg1fwmizvK1hHP2FmTfpXs:
    browser: Chrome
    os: 'Windows 10'
    ip:  -- removed --
    at: 'Sun, Jan 23, 2022 7:00 PM'

And my versions:

Statamic 3.2.31 Pro
Laravel 8.78.1
PHP 8.0.10
doublethreedigital/duplicator 2.1.0
jonassiewertsen/statamic-external-link 1.4.1
kind-work/login-notify 1.1.0
legrisch/statamic-graphql-thumbnails 0.3.0
rias/statamic-color-swatches 2.0.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.