Authentication v2

Authors: @shea786 Type: Feature

Overview

This phase of authentication we will be adding the ability for Contributors to sign up on nawhas.com via email and password.

Definitions

Term Definition
Contributor A standard user that has limited edit rights.
User A Contributor

Why are we making this change?

To allow the Public to edit nawhas.com we had added the foundation of authentication as well as login functionaltiy through Authentication v1 We want to allow the users to sign up on nawhas.com and this change will allow for users to register with username/password.

Requirements

Detailed Engineering Design

API

New Endpoints

We’ll add the following endpoints

POST /v1/auth/register
{
  "name": string,
  "email": string,
  "password": string,
  "nickname": ?string,
}
RESPONSES
  - 200: Account created and logged in
         { user: { ... } }
ERRORS
  - 422: Invalid request
         { message: "...", "errors": { email: "...", ... } }

We will be adding the following functions to App\Http\Controllers\Api\AuthController

register function will handle the creation of the user.

Frontend

Vuex Store

Actions

SignUpForm Component

A signUpForm component will handle the processes of:

Deployment Strategy

This feature needs to be coupled with a few other changes before we can deploy to production These changes will not be a part of this feature request.

Mockups