angular - Angular4 session handling -


i have sailsjs backend api's , want use angular4 frontend. wondering, how can handle sessions on angular? tried reading documentation , unable come anything.

specifically need able handle login, log out, csrf protection, etc. possible use angular4 in sails because sails has of built in?

as want use sails angular4 may need add sails.io.js in index.html <script src="/assets/sails.io/sails.io.js"></script> ,keeping sails.io.js in assets/sails.io/ folder import sailsmodule , register sails module in in app.module.ts .also add

imports:[sailsmodule.forroot()]

you may need inject sailsservice in constructor , ngoninit() call connect() method of sailsservice. can use request(options):observable method of sailsservice request(check http://sailsjs.com/documentation/reference/web-sockets/socket-client/io-socket-request , check http://sailsjs.com/documentation/concepts/sessions) of req.session can session value , property.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -