rowyio / rowy

Low-code backend platform. Manage database on spreadsheet-like UI and build cloud functions workflows in JS/TS, all in your browser.
http://rowy.io
Other
6k stars 486 forks source link

Enable auth config in .env #1195

Open cjsewell opened 1 year ago

cjsewell commented 1 year ago

When using authentication with Microsoft and your MS app is configured to for single tenant only, you must pass tenant and clientId via customParameters to firebseui.

Currently, there is no way to extend authOptions defined in firebaseui.ts.

As a work around I have modified authOptions like:

microsoft: {
  provider: "microsoft.com",
  loginHintKey: "login_hint",
  ...(process.env.REACT_APP_MS_AUTH_TENANT && process.env.REACT_APP_MS_AUTH_CLIENT_ID ? {
    customParameters: {
      tenant: process.env.REACT_APP_MS_AUTH_TENANT,
      clientId: process.env.REACT_APP_MS_AUTH_CLIENT_ID
    }
  } : undefined)
}

I am keen to submit a PR for this, but think my solution is a bit hacked in. If you could consider a better way to implement such a feature, I am more than happy to refactor it and submit a PR

Cheers

bofeiw commented 1 year ago

Hi @cjsewell, we are open for PR. Feel free to contribute and let us know when it's ready for review. Thank you.