Users

When you want to authenticate a user on a mobile app, you need to store the token in the database. This token is a piece of data that is generated during the authentication process and serves as a proof of the user's identity.

Storing the token allows the app to verify the user's identity for subsequent requests without requiring them to log in again each time. This enhances the user experience by providing seamless access and helps maintain security by ensuring that only authenticated users can access certain resources or perform specific actions.

You simply need to pass in a token from either Android or iOS when a user logs in to the system. This token will then be added to the app_token in the users table. This token is used to authenticate a user to the mobile app.

Response

{
  "id": "12345",
  "attributes": {
    "id": "12345",
    "name": "John",
    "lastname": "Doe",
    "email": "johndoe@example.com",
    "email_verified_at": "2023-10-05T14:48:00.000Z",
    "avatar": "<https://storage.example.com/public/avatar.jpg>",
    "phone_number": "+1234567890",
    "company_position": "Manager",
    "created_at": "2023-01-01T12:00:00.000Z",
    "updated_at": "2023-01-02T12:00:00.000Z",
    "company_id": 1,
    "role_id": 2,
    "full_name": "John Doe",
    "app_token": "token123"
  },
  "relationships": {
    "role": {
      "id": 2,
      "key": "manager",
      "display_name": "Manager"
    },
    "company": {
      "id": 1,
      "name": "Happyoffer Inc."
    }
  },
  "token": {
    "token": "newlyGeneratedToken123"
  }
}

Was this page helpful?