simonpacis / obsidian-grammarly-plugin

Add Grammarly spellchecking to Obsidian.md.
GNU General Public License v3.0
234 stars 11 forks source link

How can I help to develop the login feature? #13

Closed jjanvier closed 1 year ago

jjanvier commented 1 year ago

I've read https://developer.grammarly.com/docs/connected-accounts#configuring-connected-accounts-for-desktop-clients-electron and I'm trying to figure out where to start to be able to code the "login" feature.

Do you have any idea @simonpacis how to start with that?

simonpacis commented 1 year ago

Hi @jjanvier

I've been super busy with my studies this month, but I'll get back to you later today with some pointers.

Best, Simon

jjanvier commented 1 year ago

@simonpacis did you have time to take a look?

kpgabriel commented 1 year ago

I am trying to figure this out too. I may have a poor fundamental understanding of OAuth, but looking at the code I was trying to put something like this in the plugin.ts.

image

I am trying to figure out how to view the obsidian document. Like HTML inspection. If there is the documentation for that. I would greatly appreciate figuring out how to make the dev experience easier with obsidian. So far, you need to create an app on Grammarly's developer site. Then, from that app, make a desktop app, add a redirect URI the one they use is example://grammarly-auth/ and then enable the connected accounts.

This is an example using electron to add an account. I'm trying to relate that to this plugin.

kpgabriel commented 1 year ago

ctrl+shit+i is how we get dev tools in obsidian.

kpgabriel commented 1 year ago

I added this line, and it worked with the flow. But the user's Grammarly account isn't referenced.

image

LaurentGla commented 1 year ago

I issued a ticket to the Grammarly support team about the need for integration with Obsidian. They have replied that they would not have a quick fix for now, so I took the liberty to make them aware of your work. They may contact you to help, hopefully.

kpgabriel commented 1 year ago

Thanks for your support! I was able to figure it out! and made a PR.

simonpacis commented 1 year ago

Amazing thread, this one. Very thankful for the great work you guys are doing. Unfortunately I'm totally slammed with work and studies at the moment, so haven't been able to dedicate any time to this project. PR merged, I'll zip it up and create a new version later tonight (I'm GMT+8).

LaurentGla commented 1 year ago

Thanks so much for the update. Let us know when the new version is on. Would mind adding instructions for those, like me, who have installed the previous one? I suppose we would need to overwrite it, but I'd like to make sure we do it the right way. I suppose you will also ensure the new plugin is referenced in the community plugins?

simonpacis commented 1 year ago

@LaurentGla the release is here: https://github.com/simonpacis/obsidian-grammarly-plugin/releases/tag/0.2.2

  1. Delete the directory ".obsidian/plugins/obsidian-grammarly-plugin" at the root of your Obsidian vault.
  2. Download the .zip-file and extract it in your .obsidian/plugins folder so that you get the directory ".obsidian/plugins/obsidian-grammarly-plugin" again.
  3. Launch Obsidian. You might have to enable the plugin in settings again.
LaurentGla commented 1 year ago

Aha... for some reason, it is not functional anymore although I have followed your instructions. Is it normal that it is still version 0.1.1. on the plugin list?

kpgabriel commented 1 year ago

The Grammarly app client ID will need connected accounts enabled and you will need to make a Desktop client ID and add obsidian://grammarly-auth to the URLs for your Grammarly app.

On Mon, Jan 23, 2023, 1:46 PM LaurentGla @.***> wrote:

Aha... for some reason, it is not functional anymore although I have followed your instructions. Is it normal that it is still version 0.1.1. on the plugin list?

— Reply to this email directly, view it on GitHub https://github.com/simonpacis/obsidian-grammarly-plugin/issues/13#issuecomment-1400814091, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFJNREQ2UYBPIWVLM4YPIQ3WT3GZLANCNFSM6AAAAAAS5ZCWFM . You are receiving this because you commented.Message ID: @.***>

kpgabriel commented 1 year ago

This can be done through the portal for developer.grammarly.com.

kpgabriel commented 1 year ago

It will look something like this in the portal

Screenshot_20230123-141808

Screenshot_20230123-141800

You can use my client ID as well. I have it already set up. client_CKjJiRL3gDiX5Jsfa2Q8hj

I just removed it from the code because it was hard coded.

LaurentGla commented 1 year ago

I could manage by using your client ID. I could not make the other option work (it asked for URLs that I don't have). Thanks a lot!

simonpacis commented 1 year ago

Is it normal that it is still version 0.1.1. on the plugin list?

This is a mistake. If you download version 0.2.2 again it should be fixed.

jjanvier commented 1 year ago

Thank you @kpgabriel and @simonpacis. It works perfectly :pray:

simonpacis commented 1 year ago

Thank you @jjanvier, but all thanks to @kpgabriel!

I've added a client id to version 0.2.2 which enables logging in without having to setup your own client id.