Skip to content

Latest commit

 

History

History
84 lines (68 loc) · 2.22 KB

README.md

File metadata and controls

84 lines (68 loc) · 2.22 KB

Flutter Simple Auth with Riverpod & Strapi


Flutter Flutter allows you to build beautiful native apps on iOS and Android Platforms from a single codebase. The main goal of this repository is to learn how to implement simple login authentication Riverpod (flutter state management) & Strapi (Rest API)

feed example feed example feed example feed example

Package

Strapi Setup

Running in local / deploy to production

feed example



Rest API

Happy Scenario

Body

{
    "identifier": "[email protected]",
    "password": "huda12345"
}

Response

{
    "jwt": "generated_jwt_token",
    "user": {
        "id": 1,
        "username": "miftahulinc",
        "email": "[email protected]",
        "provider": "local",
        "confirmed": true,
        "blocked": false,
        "createdAt": "2023-04-02T02:46:58.297Z",
        "updatedAt": "2023-04-02T02:47:39.939Z"
    }
}

Bad Scenario

Body

{
    "identifier": "[email protected]",
    "password": "huda123453"
}

Response

{
    "data": null,
    "error": {
        "status": 400,
        "name": "ValidationError",
        "message": "Invalid identifier or password",
        "details": {}
    }
}