Fixes oauth tests (#1506)
* Fixes oauth tests * Login page type fixes * Delegates approval to github UI
This commit is contained in:
		
							parent
							
								
									1a20b0a0c6
								
							
						
					
					
						commit
						e5f8437282
					
				
					 2 changed files with 5 additions and 20 deletions
				
			
		
							
								
								
									
										11
									
								
								.github/workflows/e2e.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								.github/workflows/e2e.yml
									
									
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -4,25 +4,16 @@ on:
 | 
			
		|||
    branches:
 | 
			
		||||
      - main
 | 
			
		||||
jobs:
 | 
			
		||||
  approve:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Approve
 | 
			
		||||
        run: echo For security reasons, all pull requests need to be approved first before running any automated CI.
 | 
			
		||||
 | 
			
		||||
  test:
 | 
			
		||||
    timeout-minutes: 10
 | 
			
		||||
    name: ${{ matrix.node }} and ${{ matrix.os }}
 | 
			
		||||
    needs: [approve] # Require the first step to finish
 | 
			
		||||
    environment:
 | 
			
		||||
      name: Preview
 | 
			
		||||
    env:
 | 
			
		||||
      DATABASE_URL: postgresql://postgres:@localhost:5432/calendso
 | 
			
		||||
      BASE_URL: http://localhost:3000
 | 
			
		||||
      JWT_SECRET: secret
 | 
			
		||||
      PLAYWRIGHT_SECRET: ${{ secrets.CI_PLAYWRIGHT_SECRET }}
 | 
			
		||||
      GOOGLE_API_CREDENTIALS: ${{ secrets.CI_GOOGLE_API_CREDENTIALS }}
 | 
			
		||||
      GOOGLE_LOGIN_ENABLED: true
 | 
			
		||||
      # CRON_API_KEY: xxx
 | 
			
		||||
      CALENDSO_ENCRYPTION_KEY: ${{ secrets.CI_CALENDSO_ENCRYPTION_KEY }}
 | 
			
		||||
      NEXT_PUBLIC_STRIPE_PUBLIC_KEY: ${{ secrets.CI_NEXT_PUBLIC_STRIPE_PUBLIC_KEY }}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,6 +9,7 @@ import { WEBSITE_URL } from "@lib/config/constants";
 | 
			
		|||
import { useLocale } from "@lib/hooks/useLocale";
 | 
			
		||||
import { isSAMLLoginEnabled, hostedCal, samlTenantID, samlProductID } from "@lib/saml";
 | 
			
		||||
import { trpc } from "@lib/trpc";
 | 
			
		||||
import { inferSSRProps } from "@lib/types/inferSSRProps";
 | 
			
		||||
 | 
			
		||||
import AddToHomescreen from "@components/AddToHomescreen";
 | 
			
		||||
import Loader from "@components/Loader";
 | 
			
		||||
| 
						 | 
				
			
			@ -25,14 +26,7 @@ export default function Login({
 | 
			
		|||
  hostedCal,
 | 
			
		||||
  samlTenantID,
 | 
			
		||||
  samlProductID,
 | 
			
		||||
}: {
 | 
			
		||||
  csrfToken: string;
 | 
			
		||||
  isGoogleLoginEnabled: boolean;
 | 
			
		||||
  isSAMLLoginEnabled: boolean;
 | 
			
		||||
  hostedCal: boolean;
 | 
			
		||||
  samlTenantID: string;
 | 
			
		||||
  samlProductID: string;
 | 
			
		||||
}) {
 | 
			
		||||
}: inferSSRProps<typeof getServerSideProps>) {
 | 
			
		||||
  const { t } = useLocale();
 | 
			
		||||
  const router = useRouter();
 | 
			
		||||
  const [email, setEmail] = useState("");
 | 
			
		||||
| 
						 | 
				
			
			@ -205,7 +199,7 @@ export default function Login({
 | 
			
		|||
              <button
 | 
			
		||||
                data-testid={"google"}
 | 
			
		||||
                onClick={async () => await signIn("google")}
 | 
			
		||||
                className="w-full flex justify-center py-2 px-4 border border-transparent rounded-sm shadow-sm text-sm font-medium text-black bg-secondary-50 hover:bg-secondary-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black">
 | 
			
		||||
                className="flex justify-center w-full px-4 py-2 text-sm font-medium text-black border border-transparent rounded-sm shadow-sm bg-secondary-50 hover:bg-secondary-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black">
 | 
			
		||||
                {t("signin_with_google")}
 | 
			
		||||
              </button>
 | 
			
		||||
            </div>
 | 
			
		||||
| 
						 | 
				
			
			@ -231,7 +225,7 @@ export default function Login({
 | 
			
		|||
                    });
 | 
			
		||||
                  }
 | 
			
		||||
                }}
 | 
			
		||||
                className="w-full flex justify-center py-2 px-4 border border-transparent rounded-sm shadow-sm text-sm font-medium text-black bg-secondary-50 hover:bg-secondary-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black">
 | 
			
		||||
                className="flex justify-center w-full px-4 py-2 text-sm font-medium text-black border border-transparent rounded-sm shadow-sm bg-secondary-50 hover:bg-secondary-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black">
 | 
			
		||||
                {t("signin_with_saml")}
 | 
			
		||||
              </button>
 | 
			
		||||
            </div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue