GithubHelp home page GithubHelp logo

Comments (5)

RamiMustaklem avatar RamiMustaklem commented on August 17, 2024

@aksuhana
/login route is a frontend route, you will find it in the routes configurations inside the angular folder, it posts a request to /api/user/authenticate or something like that.
There isn't a connection between laravel and angularjs except for the index.blade.php which loads all angular files, other than that the frontend only takes data from the laravel api calls.
You should start with smaller, less complex projects in laravel and angularjs, this is a relatively complex integration between angularjs and a lot of libraries and laravel and a lot of libraries.

from laravel-angular-admin.

aksuhana avatar aksuhana commented on August 17, 2024

Thanks. One thing I am interested to know about the project is that, as there isn't a connection between laravel and angularjs except for the index.blade.php then How session is maintained using angular js as front end or JWT please explain it me in detail. I am stuck here. thanks in advance.

from laravel-angular-admin.

silverbux avatar silverbux commented on August 17, 2024

hi @aksuhana this is the code responsible for it API.service.js, it adds the token into request headers which is recognized by laravel api endpoints.

so right after user do a successful login the endpoint returns a token which angularjs save into browser local storage.

from laravel-angular-admin.

aksuhana avatar aksuhana commented on August 17, 2024

Thanks sir , but what I have seen that after storing value in local storage and then search in browser new tab windows it disappears, if such, then how session maintains after putting jwt (token) in browsers window browser local storage at It should destroy in browser new tab. But in this case still session maintains. Thanks for your great time for me. Thanks in advance for your valuable suggestion or reply

from laravel-angular-admin.

RamiMustaklem avatar RamiMustaklem commented on August 17, 2024

@aksuhana
localStorage persists even after closing tab or browser unless deleted explicitly or by key (an example which happens after logout if you've noticed in the code)
sessionStorage persists only per browser session, so it deleted itself after closing the whole browser not a tab.

so if you have no token in storage it will redirect you to login page and calls to api will not be authenticated. (now that's what should happen and to the extent of my knowledge also within the code here)

What's even more secure and best is to keep your site's data including token in cookie storage using ngCookies or cookie specialized package.

from laravel-angular-admin.

Related Issues (20)

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.