Prompt Users to Login When they Have an Expired Session with the isAuth Package

Prompt Users to Login When they Have an Expired Session with the isAuth Package

Laravel IsAuth is a Laravel package by Emre Dipi that provides control to check if a user session is dead before submitting forms. If the session is dead, a modal will prompt the user to login.

This package depends on jQuery and Sweet Alert, and a little bit of custom JS which helps provide a modal experience for your login modal:

<script>
    let user={
        name:"{{$user->name}}",
        email:"{{$user->email}}",
        photo:"{{$user->getFirstMediaUrl("image","thumb")}}" //edit this up to your system or just remove this line.
    };
</script>
<style>
    .swal-icon--custom>img{
        max-height: 250px;
        border-radius: 50%;
    }
</style>
<script src="/assets/SpiderWebtr/isAuth/isAuth.js"></script>

You can learn more about this package, get full installation instructions, and view the source code on GitHub at spiderwebtr/isauth. This package is very new, so if you try it out, provide the author with some feedback and submit anything you find issues within a pull request. A password prompt for an expired session is one of those nice touches that are helpful; building your own version might be an excellent exercise in making a package.

This package was submitted to our Laravel News Links section. This section is a place the community can post packages and tutorials around the Laravel ecosystem. Follow along on Twitter at @LaravelLinks


Filed in: News / packages


Newsletter

Join the weekly newsletter and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

PHP Data Engineer
Remote (US)
FBS
Software Developer
Remote (US & Canada)
Alley
Backend Software Engineer
Remote (UTC +/- 5)
Smartbnb
Programmer
Remote (Overlap w/ Continental US Time Zones)
Tighten
Senior Backend Engineer
Remote
64 Robots
Senior Laravel Developer
Atlanta, GA
Helium LLC
Full-Stack Developer (JS - Vue.js, PHP - Laravel)
US Remote / Telecommute
TTEC Digital