RSalman / TutorBackend

Uber for tutors backend (capstone project)
1 stars 0 forks source link

Enabled authentication and signup #38

Closed MuraadHared closed 7 years ago

MuraadHared commented 7 years ago

Sarmad and I got the authentication for devise working. For now, to signup the client needs to provide an email, name and password to the route http://localhost:3000/api/v1/users as a POST request, in the following format:

{
"user": {
          "name" : "Tester",
          "email" : "tester@uottawa.ca",
          "password" : "supersecurePassword"
}
}

If the sign up fails then error messages are provided as a response. The keys are the names of the fields and the values are the specific error message on the field.

To sign in, the client needs to provide the email and password to the route http://localhost:3000/api/v1/auth/sign_in as a POST request . ie:

{
           "email" : "tester@uottawa.ca,
          "password" : "supersecurePassword"
}

On success, the access_token is found in the Header.