Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Login and Sign Up Views #9

Open
12 tasks
ashatat opened this issue Oct 3, 2018 · 3 comments
Open
12 tasks

Build Login and Sign Up Views #9

ashatat opened this issue Oct 3, 2018 · 3 comments
Assignees
Labels

Comments

@ashatat
Copy link
Owner

ashatat commented Oct 3, 2018

Login:

The login page should include the following components:

  • Header at the top of the page.
  • Footer at the bottom of the page.
  • Login form.

Email field
Password field

  • option to login with google.
  • option to login with facebook.

Remember me button.

  • option to signup instead.

Events:

End Point: /login

Method: GET

Success response:

  • status code: 200
  • Response content type: html

Error response:

  • Status Code: 500
  • Response content type: json
  • Response object:
{ err: true, 
  message: 'Something wrong went on! Please try again', 
}

Method: POST

Validation required: username, passowrd
Permission requirement(auth): none.
Success response:

  • status code: 200
  • Response content type: json
  • Response object:
{ err: false, 
  message: 'User login is successful',
 token: token string,
 firstName: user first name,
}

Sign Up:

The login page should include the following components:

  • Header at the top of the page.
  • Footer at the bottom of the page.
  • Sign up form.

Email field
Password field

  • option to sign up with google.
  • option to sign up with facebook.

Remember me button.

  • option to login instead.

Events:

End Point: /sign-up

Method: GET (will be reassigned to react router later).

Success response:

  • status code: 200
  • Response content type: html

Error response:

  • Status Code: 500
  • Response content type: json
  • Response object:
{ err: true, 
  message: 'Internal Server Error! Please try again', 
}
  • Status Code: 404
  • Response content type: json
  • Response object:
{ err: true, 
  message: 'Page not found', 
}

Method: POST

request object (no OAuth) includes:

  • User email
  • User password
  • password confirmation
  • Is user remembered?

Validation required:

  • database constraints for all fields (null, unique, etc).
  • regex for proper first and last name, what password must include and proper email format.

Permission requirement(auth): none.
Success response:

  • status code: 200
  • Response content type: json
  • Redirect: true.
  • Response object:
{ err: false, 
  message: 'User login is successful',
 token: string,
 firstName: string,
}

Error response:

  • Status Code: 500
  • Response content type: json
  • Response object:
{ err: true, 
  message: 'Something wrong went on! Please try again', 
}
  • Status Code: 404
  • Response content type: json
  • Response object:
{ err: true, 
  message: 'Page not found', 
}
@FarahZaqout FarahZaqout self-assigned this Oct 3, 2018
@ashatat
Copy link
Owner Author

ashatat commented Oct 5, 2018

I am not sure about the HTML GET /login endpoints here,
the way I see it they are just routes in the react app?
I mean we should have one endpoint / that load the react app
then everything will be done inside the react router?

@FarahZaqout
Copy link
Collaborator

FarahZaqout commented Oct 6, 2018

That is true. Too much non-react work got into my head. Will keep it in mind.

I think it's good to have the endpoints here for now, and then we will have an epic react-router issue that will include all of them.

Also whenever we are fetching things from the backend, we will still have to do a get/post/put...etc request.

What do you think?

@FarahZaqout FarahZaqout removed their assignment Oct 6, 2018
@ashatat
Copy link
Owner Author

ashatat commented Oct 6, 2018

yeah I think you're right
when we write the detailed issues it'll make more sense, I guess

This was referenced Oct 7, 2018
@FarahZaqout FarahZaqout self-assigned this Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants