[Front-end] Refactored login code to use new post factory