Started rewrite of the application. Created new branch and set up the initial routes server-side. Need to begin the client-side.
Changed the way templates will be got from the server to be static files rather than Laravel routes as I feel this makes more sense. Things that actually need to be protected server-side will still be able to.
Changed the readme from the default Laravel one
Added angular-ui-router as a dependency and tested to make sure it works. Now the work begins to set up the actual routes.
Beginning the client-side routing using ui-router. Need to figure out how the single post thing works in this case.
Added handling for single post IDs in the router.
Added final route for now and a log in link.
Forgot a file
Initial login form and placeholder token generation.
The log in form correctly posts to the server, and the server is capable of taking this and correctly checking against a user (currently there is no user model, however, so it is a placeholder if). The server also correctly responds with either a token or a 401 error. The token is a placeholder for now. Need to make the client actually handle using this token, and then send it back when trying to access restricted routes. Also need to actually make some routes restricted!
The beginnings of properly protecting routes!
There is still a lot to do. The primary thing is to make the tokens meaningful, instead of always the same and full of meaningless information. Keeping a store of issued tokens server-side would be a good idea but will save that for later. More importantly is to get the client to properly keep its state, whether it is logged in or not. Going to need to make a bunch of services and such to handle this I think.
Refactoring user sessions.
Refactored the getting of tokens etc into services to make things easier to work with and the code cleaner. There is now a Session service that contains all the user information and token. Now need to go and make the tokens meaningful.
Continuing work on the authentication.
Most of it is done now. The server is actually checking to see if the token is valid, sort of. It does need to be adjusted to actually check for a proper expiry date, rather than automatically saying it has expired. Also need to implement some broadcasts on the client-side to update the UI in some places when the user logs in. Otherwise things are looking pretty good!
Tokens pretty much done.
The tokens now have a proper expiry date (7 days in the future) as as well as an issued at date. The auth interceptor works correctly and the routes are protected as long as no one else has the token.
Storing the session token in browser session storage. Might make it easier to remember the token.
Added broadcasting auth events to UI, and moved navigation to a directive.
The navigation has been split out into a directive. It also now has some listeners attached to it to listen for broadcasts about authentication events. AuthService sends out these broadcasts. When a user logs in their name is displayed and a log out button appears, as well as the link to make a new post. When they log out, the log in link is show instead, and their name and the new post link disappear.
Set up database with users.
The users table now exists in the database, along with a seed user. Also now checking against the hashed password stored in the databse when logging in, and returning the stored user's name, instead of hardcoded test data. Next up, the posts themselves.
Updated readme. Migrated and seeded Posts.
The posts table now exists and is seeded. Should probably change the seeding to have some published posts as well though. The readme was also updated to reflect the WIP nature of the project, as it is now public.
fixing getting posts
Updated readme
Added PostService
Ignoring the burning desire to rename it RoyalMail, the service for getting posts now works, including for unpublished posts. Also created the controller for handling the home page and regular posts, but this might have to be split up anyway.