Skip to content

tewalds/angular-auth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-auth

This is an AngularJS authentication demo.

Backend

There's a backend written in Go that tracks users and sessions. It uses cookies with simple session ids to track sessions. It has a dependency on github.com/ant0ine/go-json-rest/rest.

To run the backend: angular-auth $ cd server angular-auth/server $ go run auth.go

Frontend

The front end is in angular. It defines several routes with different visibilities, and an auth system to enforce them. All the magic happens in a resolve that is added to all routes. The resolve will check the user's session state before the state transition happens, asking the server for the user's information if it isn't already known, and sending the user to a login page if it's not authenticated. There's also an httpProvider hook that will clear the user's session if any request fails, forcing a login if that makes sense.

About

AngularJS authentication

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 57.1%
  • Go 42.9%