shopinvader / locomotive-shopinvader

LocomotiveCMS Plugin for Shopinvader
https://shopinvader.com
MIT License
12 stars 15 forks source link

implement the jwt token endpoint #58

Closed did closed 1 year ago

did commented 4 years ago

By doing a POST request to `/locomotive_jwt', ShopInvader will return a JWT. Here is the JSON response:

{ "token": "<JWT token>" }

Once decoded, you will be able to get access to the payload which follows this structure:

{
  "data": {
    "site_handle": "my-site",
    "account": {
      "_id": "42",
      "email": "john@doe.net"
    }
  }
}

It requires the Wagon developer to create new metafields namespace for the site: authentication. This namespace will have 2 attributes: jwt_secret (secret key) and jwt_validity (validity of the token in seconds).

Note:

did commented 4 years ago

@Laurent-Corron @sbidoul @sebastienbeau Voici un première version. A en discuter semaine prochaine ?

lmignon commented 4 years ago

@did Thank you! It seems very simple to configure and use. We'll be back as soon as we've tested it.

sebastienbeau commented 4 years ago

I have done a rebase, We will start to review and test it

sbidoul commented 4 years ago

@sebastienbeau can we merge this and do a release of https://github.com/shopinvader/docker-locomotive-shopinvader so we can deploy?

cc/ @thibaultrey @Cedric-Pigeon

sebastienbeau commented 1 year ago

@sbidoul do you still need this and I merge it or I close the PR?

sbidoul commented 1 year ago

@sebastienbeau let's merge it.