From 7b65942de2eaba2687e8f145a49a3f734c8c9f47 Mon Sep 17 00:00:00 2001 From: Deepak Prabhakara Date: Wed, 2 Feb 2022 18:33:27 +0000 Subject: [PATCH] Feature/sso signup (#1555) * updated saml-jackson * if logged in redirect to getting-started page with username in the query param * fixed issue with mixed up Google login, profile.id is undefined and this is causing the first record to be retrieved instead of the AND query failing * updated updated saml-jackson * document PGSSLMODE for Heroku * tweaks to PGSSLMODE doc * for self-hosted instance just allow user to signin with any identity (as long as email matches) * fixed submitting flag * added username to onboarding flow (if requested during signup) * added telemetry for google login, saml login, saml config * check if firstName and lastName are defined * convert mutation to an async op * added e2e test to ensure username query param gets picked up during onboarding * fixed minor typo and added note about configuring Google integration as an Internal app when self-hosting * cleaned up unnecessary ssr in sso signup routes * renamed function * Revert "cleaned up unnecessary ssr in sso signup routes" This reverts commit 3607ffef79542d8ca4277a64be38d35bd9457960. * moved client side code to useEffect hook * - format - fixed Save button in SAML config component Co-authored-by: Peer Richelsen Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .env.example | 7 +- components/NavTabs.tsx | 4 +- ee/components/saml/Configuration.tsx | 22 +- lib/telemetry.ts | 3 + package.json | 4 +- pages/api/auth/[...nextauth].tsx | 37 +- pages/auth/login.tsx | 19 +- pages/auth/sso/[provider].tsx | 57 +- pages/getting-started.tsx | 83 +- playwright/onboarding.test.ts | 15 +- server/routers/viewer.tsx | 6 +- yarn.lock | 2451 ++++++++++++++------------ 12 files changed, 1532 insertions(+), 1176 deletions(-) diff --git a/.env.example b/.env.example index e9f26198..96ad2363 100644 --- a/.env.example +++ b/.env.example @@ -10,13 +10,15 @@ NEXT_PUBLIC_LICENSE_CONSENT='' # DATABASE_URL='postgresql://:@:/' DATABASE_URL="postgresql://postgres:@localhost:5450/calendso" -# Needed to enable Google Calendar integrationa and Login with Google +# Needed to enable Google Calendar integration and Login with Google # @see https://github.com/calendso/calendso#obtaining-the-google-api-credentials GOOGLE_API_CREDENTIALS='{}' # To enable Login with Google you need to: # 1. Set `GOOGLE_API_CREDENTIALS` above # 2. Set `GOOGLE_LOGIN_ENABLED` to `true` +# When self-hosting please ensure you configure the Google integration as an Internal app so no one else can login to your instance +# @see https://support.google.com/cloud/answer/6158849#public-and-internal&zippy=%2Cpublic-and-internal-applications GOOGLE_LOGIN_ENABLED=false BASE_URL='http://localhost:3000' @@ -30,6 +32,9 @@ PLAYWRIGHT_SECRET= # @see https://github.com/calendso/calendso/tree/main/ee#setting-up-saml-login # SAML_DATABASE_URL="postgresql://postgres:@localhost:5450/cal-saml" # SAML_ADMINS='pro@example.com' +# If you use Heroku to deploy Postgres (or use self-signed certs for Postgres) then uncomment the follow line. +# @see https://devcenter.heroku.com/articles/connecting-heroku-postgres#connecting-in-node-js +##PGSSLMODE='no-verify' # @see: https://github.com/calendso/calendso/issues/263 # Required for Vercel hosting - set NEXTAUTH_URL to equal your BASE_URL diff --git a/components/NavTabs.tsx b/components/NavTabs.tsx index 6d79ec00..c3581005 100644 --- a/components/NavTabs.tsx +++ b/components/NavTabs.tsx @@ -17,7 +17,9 @@ const NavTabs: FC = ({ tabs, linkProps }) => { const router = useRouter(); return ( <> -