{"_id":"@curvenote/remix-auth-google","name":"@curvenote/remix-auth-google","dist-tags":{"latest":"3.0.0"},"versions":{"3.0.0":{"name":"@curvenote/remix-auth-google","version":"3.0.0","main":"./build/index.js","types":"./build/index.d.ts","sideEffects":false,"type":"module","scripts":{"build":"tsc","typecheck":"tsc --project tsconfig.json --noEmit","lint":"eslint ./src --fix","format":"prettier --config .prettierrc --write --list-different --ignore-path .gitignore .","prepare":"husky","test":"echo \"Error: no test specified\" && exit 0"},"keywords":["remix","remix-auth","auth","authentication","strategy","google-auth"],"author":{"name":"Steve Purves","email":"steve@curvenote.com"},"contributors":[{"name":"Bhanu Teja Pachipulusu","email":"pbteja1998@gmail.com","url":"https://github.com/pbteja1998"}],"repository":{"url":"git+https://github.com/pbteja1998/remix-auth-google.git","type":"git"},"license":"MIT","peerDependencies":{"@remix-run/server-runtime":"^2.0.1","remix-auth":"^4.0.0"},"devDependencies":{"@eslint/js":"^9.15.0","@remix-run/node":"^2","@remix-run/react":"^2","@remix-run/server-runtime":"^2","@total-typescript/tsconfig":"^1.0.4","@types/jest":"^29.5.14","@types/node":"^22.10.1","@typescript-eslint/eslint-plugin":"^8.16.0","@typescript-eslint/parser":"^8.16.0","babel-jest":"^29.7.0","eslint":"^9.15.0","eslint-config-galex":"^3.5.3","globals":"^15.12.0","husky":">=6","lint-staged":">=12.1.4","prettier":"^3.4.1","react":"^18.3.1","remix-auth":"^4.0.0","ts-node":"^10.9.2","typescript":"^5.7.2","typescript-eslint":"^8.16.0"},"dependencies":{"remix-auth-oauth2":"^3.1.0"},"lint-staged":{"*.{js,jsx,ts,tsx}":"yarn lint","*.{js,jsx,ts,tsx,css,json,md}":"yarn format"},"engines":{"node":">=20.0.0"},"publishConfig":{"access":"public"},"_id":"@curvenote/remix-auth-google@3.0.0","gitHead":"b15ff84a38ee4198961147d5e9dde3c7bafc0ce7","description":"**Forked** and updated from [https://github.com/pbteja1998/remix-auth-google](https://github.com/pbteja1998/remix-auth-google) to use the latest `remix-auth-oauth2` strategy.","bugs":{"url":"https://github.com/pbteja1998/remix-auth-google/issues"},"homepage":"https://github.com/pbteja1998/remix-auth-google#readme","_nodeVersion":"22.11.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-OwzVeAgMZaQ2UKw/V9ij6cNR0iUcYCjqgTfi7BZ3+Mk1wrIGJ0HWUMICYlYkfx1X0HHuHFYV2JKQdY7MpSt9ew==","shasum":"7bc828bea4c253a6d7a8a01fdaef4f01b8c00772","tarball":"https://registry.npmjs.org/@curvenote/remix-auth-google/-/remix-auth-google-3.0.0.tgz","fileCount":6,"unpackedSize":14705,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWgbytGkTJN/kslJDXeiXqbixPlfqLD4A750OXNnzzqQIgekTI6b4kyJ1PpaF2hKHnX+c2JuY+KNQWrsfLUkFaIDE="}]},"_npmUser":{"name":"stevejpurves","email":"stevejpurves@gmail.com"},"directories":{},"maintainers":[{"name":"fwkoch","email":"franklinwkoch@gmail.com"},{"name":"rowanc1","email":"rowanc1@gmail.com"},{"name":"stevejpurves","email":"stevejpurves@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remix-auth-google_3.0.0_1733517242812_0.3543644048062824"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-06T20:34:02.604Z","3.0.0":"2024-12-06T20:34:03.013Z","modified":"2024-12-06T20:34:03.457Z"},"maintainers":[{"name":"fwkoch","email":"franklinwkoch@gmail.com"},{"name":"rowanc1","email":"rowanc1@gmail.com"},{"name":"stevejpurves","email":"stevejpurves@gmail.com"}],"description":"**Forked** and updated from [https://github.com/pbteja1998/remix-auth-google](https://github.com/pbteja1998/remix-auth-google) to use the latest `remix-auth-oauth2` strategy.","homepage":"https://github.com/pbteja1998/remix-auth-google#readme","keywords":["remix","remix-auth","auth","authentication","strategy","google-auth"],"repository":{"url":"git+https://github.com/pbteja1998/remix-auth-google.git","type":"git"},"contributors":[{"name":"Bhanu Teja Pachipulusu","email":"pbteja1998@gmail.com","url":"https://github.com/pbteja1998"}],"author":{"name":"Steve Purves","email":"steve@curvenote.com"},"bugs":{"url":"https://github.com/pbteja1998/remix-auth-google/issues"},"license":"MIT","readme":"# @curvenote/remix-auth-google\n\n**Forked** and updated from [https://github.com/pbteja1998/remix-auth-google](https://github.com/pbteja1998/remix-auth-google) to use the latest `remix-auth-oauth2` strategy.\n\n<!-- Description -->\n\nThe Google strategy is used to authenticate users against a Google account. It extends the OAuth2Strategy.\n\n## Supported runtimes\n\n| Runtime    | Has Support |\n| ---------- | ----------- |\n| Node.js    | ✅          |\n| Cloudflare | ✅          |\n\n<!-- If it doesn't support one runtime, explain here why -->\n\n## Usage\n\n### Create an OAuth application\n\nFollow the steps on [the Google documentation](https://developers.google.com/identity/protocols/oauth2/web-server#creatingcred) to create a new application and get a client ID and secret.\n\n### Create the strategy instance\n\n```ts\n// app/services/auth.server.ts\nimport { GoogleStrategy } from 'remix-auth-google'\n\nlet googleStrategy = new GoogleStrategy(\n  {\n    clientID: 'YOUR_CLIENT_ID',\n    clientSecret: 'YOUR_CLIENT_SECRET',\n    callbackURL: 'https://example.com/auth/google/callback',\n  },\n  async ({ accessToken, refreshToken, extraParams, profile }) => {\n    // Get the user data from your DB or API using the tokens and profile\n    return User.findOrCreate({ email: profile.emails[0].value })\n  },\n)\n\nauthenticator.use(googleStrategy)\n```\n\n### Setup your routes\n\n```tsx\n// app/routes/login.tsx\nexport default function Login() {\n  return (\n    <Form action=\"/auth/google\" method=\"post\">\n      <button>Login with Google</button>\n    </Form>\n  )\n}\n```\n\n```tsx\n// app/routes/auth.google.tsx\nimport { redirect, type ActionFunctionArgs } from '@remix-run/node'\nimport { authenticator } from '~/services/auth.server'\n\nexport let loader = () => redirect('/login')\n\nexport let action = ({ request }: ActionFunctionArgs) => {\n  return authenticator.authenticate('google', request)\n}\n```\n\n```tsx\n// app/routes/auth.google.callback.tsx\nimport type { LoaderFunctionArgs } from '@remix-run/node'\nimport { authenticator } from '~/services/auth.server'\n\nexport let loader = ({ request }: LoaderFunctionArgs) => {\n  return authenticator.authenticate('google', request, {\n    successRedirect: '/dashboard',\n    failureRedirect: '/login',\n  })\n}\n```\n","readmeFilename":"README.md"}