mycookbook / web-client

cookbookshq frontend
https://web.cookbookshq.com
Other
1 stars 1 forks source link

As an authorized user, I want to be able to signin via magiclink #63

Open fokosun opened 1 year ago

fokosun commented 1 year ago

Authorized uses are users that have been given the permission to access select features like signing in with magic link. The permissions are handled in the back office.

When a user clicks on the button to login with magic link:

How the backend handles the requests:

~Backend api is not ready yet.~

IMPORTANT:

Please rename /tiktok to /auth you can find this in router/index.js

### Step 1

## user's location is not recognized, additional info is required i.e registered email

POST /api/v1/auth/magiclink

response {
    "action_required":true,
    "required": {
        "email":"Looks like this is your first signing in with magiclink! Kindly provide your registered email for verification."
    }
}

statusCode: 422
### Step 2

## prompt user to provide registered email, send that along in the request

POST /api/v1/auth/magiclink?email={email}

## success:
response {
    token:{token},
    _d:{id}
}

statusCode: 200

## redirect user to `/#/auth?token={token}&_d={_d}

## error:
response {
    error: "message"
}

## display the error message
statusCode: 401