KevinBatdorf / block-diffusion

A WordPress block to generate images from text prompts
https://wordpress.org/plugins/stable-diffusion/
24 stars 6 forks source link

Refactor auth and decouple modal #61

Closed KevinBatdorf closed 1 year ago

KevinBatdorf commented 1 year ago

This PR removes the block replacer and decouples the modal from the rest of the code (and more specifically the block injection).

  1. Simplifies the login form and abstracts it so it can load from any page.
  2. Moves the modal to a filter only interface. Everything is essentially the same, but you can only use the modal from the button that shows on the image block (for now anyway). I will add another block that is a more streamlined UI that can be used on the front end of the site.
  3. Abstracts the token to the server only, making room for frontend access. I still need to rewrite the rest router to handle custom permissions but this was a good refactor. The auth gate is also easier to reason with and is driven by swr.

This is still a WIP until I update the tests