{"id":29573147,"url":"https://github.com/auth0-samples/universal-login-samples","last_synced_at":"2026-01-20T18:03:03.887Z","repository":{"id":267665770,"uuid":"897469012","full_name":"auth0-samples/universal-login-samples","owner":"auth0-samples","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-28T11:01:41.000Z","size":2503,"stargazers_count":1,"open_issues_count":3,"forks_count":3,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-11-30T18:42:16.800Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/auth0-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-02T17:23:42.000Z","updated_at":"2025-11-21T07:25:13.000Z","dependencies_parsed_at":"2024-12-11T18:24:24.096Z","dependency_job_id":"61463667-ff68-4e0c-b398-b2186dceb604","html_url":"https://github.com/auth0-samples/universal-login-samples","commit_stats":null,"previous_names":["auth0-samples/universal-login-samples"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/auth0-samples/universal-login-samples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0-samples%2Funiversal-login-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0-samples%2Funiversal-login-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0-samples%2Funiversal-login-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0-samples%2Funiversal-login-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auth0-samples","download_url":"https://codeload.github.com/auth0-samples/universal-login-samples/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auth0-samples%2Funiversal-login-samples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-19T05:31:59.305Z","updated_at":"2026-01-20T18:02:58.864Z","avatar_url":"https://github.com/auth0-samples.png","language":null,"funding_links":[],"categories":["Projects Using Auth0"],"sub_categories":[],"readme":"\n# Universal Login Sample App\n\nThis is a sample application to help you build a customized login screen for Auth0 login using React, TypeScript, and Vite.\nUniversal Login offers a streamlined experience for users and does not require the use of JavaScript for customization.\n\n\u003cimg width=\"956\" alt=\"Screenshot 2024-11-27 at 6 43 07 PM\" src=\"https://github.com/user-attachments/assets/c9c65f79-fe28-41e5-a5b0-83d85d7ae837\"\u003e\n\n## Prerequisites\n\nBefore you start, make sure you have the following:\n\n1. An Auth0 staging or development tenant with an active [custom domain](https://auth0.com/docs/customize/custom-domains).\n2. Configure the auth0 tenant to use the [Identifier First Authentication Profile](https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first).\n3. A [React quickstart](https://github.com/auth0-samples/auth0-react-samples/tree/master/Sample-01) application configured to run with your custom domain.\n4. Configure [Application metadata](https://auth0.com/docs/get-started/applications/application-settings) to run quickstart.\n\n## Getting Started\n\nFollow these steps to get the application up and running locally:\n\n### 1. Clone the Repository\n\n```sh\ngit clone \u003crepository-url\u003e\ncd \u003crepository-directory\u003e\n```\n\n### 2. Install Dependencies\n\n```sh\nnpm install\n```\n\n### 3. Build the Application\n\n```sh\nnpm run build\n```\n\n### 4. Serve the Application\n\nAfter building the application, you can serve it locally using `http-server`:\n\n```sh\nnpx http-server dist -p 3032\n```\n\nThis will start a local server on port 3032. You can access the application by navigating to `http://127.0.0.1:3032` in your web browser.\n\n### 5. Test the Application with sample quickstart\n\nGo to your quickstart applicaiton and Login.\n\n## How the Login Works\n\n### Creating and Appending the Root Element\n\nIn the `src/main.tsx` file, we create a `div` element and append it to the `body` of the document. This is necessary for the Universal Login to work correctly. Here is the relevant code:\n\n```tsx\nconst rootElement = document.createElement(\"div\");\nrootElement.id = \"root\";\n\ndocument.body.appendChild(rootElement);\ndocument.body.style.overflow = \"hidden\";\n```\n\n### Initializing Screen Objects LoginId, LoginPassword ...\n\nIn the src/screens/LoginId/index.tsx file, we initialize an object for the LoginId screen. This allows us to manage the state and behavior specific to this screen.\n\n```tsx\nimport React, { useState } from \"react\";\nimport LoginIdInstance from \"ul-javascript\";\n\nconst LoginIdScreen: React.FC = () =\u003e {\n  const [loginIdManager] = useState(() =\u003e new LoginIdInstance()); //lazy initialization\n\n  const handleLogin = () =\u003e {\n    //Logic for continue\n    loginIdManager.login({username:\"\", captcha: \"\"})\n  }\n\n  return (\n    \u003cdiv\u003e\n      {/* Render the login ID screen content */}\n      \u003cbutton onclick={handleLogin}\u003eContinue\u003cbutton\u003e\n    \u003c/div\u003e\n  );\n};\n\nexport default LoginIdScreen;\n```\n\n### Error handling for login ...\n\nIn the src/screens/LoginId/index.tsx file, we initialize an object for the LoginId screen. This allows us to manage the state and behavior specific to this screen.\n\n```tsx\nimport React, { useState } from \"react\";\nimport LoginIdInstance from \"@auth0/auth0-acul-js/login-id\";\n\nconst LoginIdScreen: React.FC = () =\u003e {\n  const [loginIdManager] = useState(() =\u003e new LoginIdInstance()); //lazy initialization\n\n  const errors = loginIdManager.getError();\n\n  const handleLogin = () =\u003e {\n    //Logic for continue\n    loginIdManager.login({username:\"\", captcha: \"\"})\n  }\n\n  return (\n    \u003cdiv\u003e\n      {/* Render the login ID screen content */}\n      \u003cbutton onclick={handleLogin}\u003eContinue\u003cbutton\u003e\n      {loginIdManager.transaction.hasErrors \u0026\u0026 errors \u0026\u0026 (\n        // A custom React component that renders a \u003cdiv\u003e with error details\n        \u003cErrorMessages errors={errors} /\u003e\n      )}\n    \u003c/div\u003e\n  );\n\nexport default LoginScreen;\n```\n\n## Additional Information\n\n- This project uses Vite for fast development and build processes.\n- ESLint is configured to enforce code quality and consistency.\n- SCSS is used for styling, with a focus on modular and reusable styles.\n\nFor more details on how to customize and extend this application, refer to the official documentation of the libraries and tools used:\n\n- [React](https://reactjs.org/)\n- [TypeScript](https://www.typescriptlang.org/)\n- [Vite](https://vitejs.dev/)\n- [Auth0](https://auth0.com/)\n\n### Have Fun with Your Own Coding Style!\n\nFeel free to use your own coding style to create beautiful login pages. Customize the styles, add animations, and make the user experience delightful.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0-samples%2Funiversal-login-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauth0-samples%2Funiversal-login-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauth0-samples%2Funiversal-login-samples/lists"}