cheft/riot-spa-template

Authentication and Authorization examples

Closed this issue · 1 comments

zelid commented

Hello,

Cheftjs looks promising!

Do you have any Authentication and Authorization examples?
With ability to register / login / logout and control which parts of tag are available for particular role?

Thanks!

cheft commented

This is what the backend should do, such as for J2EE Shiro.
return status code 401 for unauthorized api.
in cheftjs:

app.on('ajaxed', function(rep, status) {
    if(rep.status === '401') {
        app.router.go('login');
    }
});