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

Login (connect) with Emacs #35

Open
jcs090218 opened this issue May 30, 2022 · 4 comments
Open

Login (connect) with Emacs #35

jcs090218 opened this issue May 30, 2022 · 4 comments
Labels

Comments

@jcs090218
Copy link
Member

jcs090218 commented May 30, 2022

Trying to get the old method 2 back, see the discussion https://github.com/grammarly/grammarly-for-developers/discussions/18 (moved to znck/grammarly#281).

@znck
Copy link

znck commented Jul 6, 2022

You can add scheme to redirect function to support connect account.

https://github.com/znck/grammarly/blob/d4859a95ea0067803f7e30b4566abe5a15c4de6e/redirect/functions/redirect.js#L2

@jcs090218
Copy link
Member Author

Thanks for the information! ❤️

I wonder how does this work? If I understand fully, I don't think Emacs can handle URI redirection.


I reckon these following lines are the key, which Emacs can NOT do.

https://github.com/znck/grammarly/blob/fb10db7e5a7bd23a49537aa899905e8222d079dd/extension/src/GrammarlyClient.ts#L126-L143

@znck
Copy link

znck commented Jul 8, 2022

Another approach is to start a local server to handle redirect.

e.g. I can redirect to http://127.0.0.1:5555/emacs-oauth-callback on successful authorisation.

@jcs090218
Copy link
Member Author

e.g. I can redirect to http://127.0.0.1:5555/emacs-oauth-callback on successful authorisation.

Awesome! Sounds good to me! ❤️

Is there an example code for this (in TypeScript is good)? I use to look at the code directly under your repo grammarly/extension, but this became meaningless if I go for another approach. How do I send URL request, etc?

Basically, these lines https://github.com/znck/grammarly/blob/def921982df6bd83303efe785f1a6bd59352f4ab/extension/src/GrammarlyClient.ts#L188-L202. How should I replace this?

Very thank for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants