Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Enode linking endpoints #72

Open
ericcccsliu opened this issue Apr 11, 2023 · 0 comments · May be fixed by #87
Open

Create Enode linking endpoints #72

ericcccsliu opened this issue Apr 11, 2023 · 0 comments · May be fixed by #87

Comments

@ericcccsliu
Copy link
Collaborator

We need to create API endpoints to handle the process of directing a user to Enode's Link UI.

/enode/link

  • Redirects the user to the Enode Link UI. This endpoint should give Enode a redirect URI of /enode/link-return.

/enode/link-return

  • Determines whether or not the link was successful.
    If successful, links the current Auth0 user’s clients their newly linked inverters. This becomes the record’s enode_link_uuid, the primary key.
    Redirects the user back to a URL given to /enode/link

Here is the respective code for generating a link in our current repo:

https://github.com/openclimatefix/pv-sites-mobile/blob/0091e4d54503c872bf90e256eb12d7ae2bd9e454/lib/enode.ts#L70-L83

And here are those respective endpoints in our current repo:

https://github.com/openclimatefix/pv-sites-mobile/blob/0091e4d54503c872bf90e256eb12d7ae2bd9e454/pages/api/%5B...mockApiRoute%5D.ts#L103-L124

This was referenced Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant