{"_id":"@doncicuto/remix-auth-bitbucket","_rev":"1-88d8096fcf179b38235deaaf9de3655f","name":"@doncicuto/remix-auth-bitbucket","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@doncicuto/remix-auth-bitbucket","version":"1.0.0","main":"./build/index.js","types":"./build/index.d.ts","scripts":{"build":"tsc --project tsconfig.json","typecheck":"tsc --project tsconfig.json --noEmit","lint":"eslint --ext .ts,.tsx src/","test":"jest --config=config/jest.config.ts --passWithNoTests","coverage":"npm run test -- --coverage"},"keywords":["remix","remix-auth","auth","authentication","strategy","bitbucket-auth"],"author":{"name":"Miguel Cabrerizo","email":"doncicuto@gmail.com","url":"https://github.com/doncicuto"},"repository":{"url":"git+https://github.com/doncicuto/remix-auth-bitbucket.git","type":"git"},"license":"MIT","peerDependencies":{"@remix-run/server-runtime":"^1.1.1","remix-auth":"^3.2.1"},"devDependencies":{"@babel/core":"^7.14.2","@babel/preset-env":"^7.14.1","@babel/preset-react":"^7.13.13","@babel/preset-typescript":"^7.13.0","@remix-run/node":"^1.1.1","@remix-run/react":"^1.1.1","@remix-run/server-runtime":"^1.0.0","@types/debug":"^4.1.7","@types/jest":"^26.0.23","@typescript-eslint/eslint-plugin":"^4.23.0","@typescript-eslint/parser":"^4.23.0","babel-jest":"^26.6.3","eslint":"^7.26.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jest":"^24.3.6","eslint-plugin-jest-dom":"^3.9.0","eslint-plugin-prettier":"^3.4.0","eslint-plugin-unicorn":"^32.0.1","jest":"^26.6.3","jest-fetch-mock":"^3.0.3","prettier":"^2.3.2","react":"^17.0.2","ts-node":"^9.1.1","typescript":"^4.3.5"},"dependencies":{"debug":"^4.3.3","remix-auth":"^3.2.1","remix-auth-oauth2":"^1.2.0"},"gitHead":"df7e1239b611ca35cc3b84da42d811b978d787ed","description":"The Bitbucket Cloud strategy for [remix-auth](https://github.com/sergiodxa/remix-auth) is used to authenticate users against a Bitbucket Cloud account. It extends the OAuth2Strategy.","bugs":{"url":"https://github.com/doncicuto/remix-auth-bitbucket/issues"},"homepage":"https://github.com/doncicuto/remix-auth-bitbucket#readme","_id":"@doncicuto/remix-auth-bitbucket@1.0.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-A0el7t4tIdzNnH95qkkpJos8NiSr8rP6UeSP+zBohwA7oL8yn2hqNPY1nIcJCv9Cf5gtZLcKINeYz0vdRyKUZQ==","shasum":"514af9fd0e180a852832035267a38aaf680fc4b5","tarball":"https://registry.npmjs.org/@doncicuto/remix-auth-bitbucket/-/remix-auth-bitbucket-1.0.0.tgz","fileCount":5,"unpackedSize":11621,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5a7qCRA9TVsSAnZWagAAZv8P/183AzDVCHV5RB4CV7NJ\ngfFStV7qP2Ej1gh8lIZgFKVd4H862wTPLz/r5KMxiAj0TgSagiZbnoOZze+9\nUfx8z8YZpB6erPFjoCiWvnppQIRyOVj9bf4y48op9dxy26S/ud/ZJqtvJ4B4\n8I/k2ve92QXutdM7nrjHwX+VDM3Jm/O28iSp5R430efg0quuONCzj63usCb6\n6z3Lmbj7DHPio4wQXrNyTuCwks74LyHvB+4RXwlAXhlVH8UFIw+pYgRqprOK\nLOS860FaNbbNAaRUtSGokzMB7qPjg1aa7ZML2YAuIolYu61eAP0ZjuBiLHQv\nULSeHh27+sTM3IV1HcaIq0kKcZZj6b6ujUfwkG+bsvT8h2zsyp1E4ypfpwMx\nW8sdzwh5k1FGMtiRyseeM4OygynAm43CDxnqywhqfyIkg7xjuyBiaxTrjv4p\n+mTJfX3ApA/Z70xRe5ZewCNDEVMb/6qA76jdlnZJR3VnLZrO0n0cBkM8rNoy\nMMaQUAVQgmX7XJdsNgDcigeLH/ibRUG4SnXddAbhS4v8xIc0q7FLODLFaYpO\n7wKPbGMbCEszjYXmj3XMSDaoBxKi/Y4WRa/5OV1MTtKL8Db2bpagPk2RYG/s\nZLZfwJKBbvtH2Niu8j0nqrD5UvG1Xzc6OX6dsTbth2RQDvzqQO+sh1OdZhYA\nPy3z\r\n=cCBt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICqzOw2tkNLfrXGyJBbdX3SL/jYnGE9bpojABsOPO7rAAiABC4yL0AdE8sAGbyNOxI4pN92odpR1J66m+pBSm+8o4A=="}]},"_npmUser":{"name":"mcabrerizo","email":"mcabrerizo@arrakis.ovh"},"directories":{},"maintainers":[{"name":"mcabrerizo","email":"mcabrerizo@arrakis.ovh"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remix-auth-bitbucket_1.0.0_1642442474255_0.13933881813347004"},"_hasShrinkwrap":false}},"time":{"created":"2022-01-17T18:01:14.206Z","1.0.0":"2022-01-17T18:01:14.470Z","modified":"2022-04-05T05:15:09.581Z"},"maintainers":[{"name":"mcabrerizo","email":"mcabrerizo@arrakis.ovh"}],"description":"The Bitbucket Cloud strategy for [remix-auth](https://github.com/sergiodxa/remix-auth) is used to authenticate users against a Bitbucket Cloud account. It extends the OAuth2Strategy.","homepage":"https://github.com/doncicuto/remix-auth-bitbucket#readme","keywords":["remix","remix-auth","auth","authentication","strategy","bitbucket-auth"],"repository":{"url":"git+https://github.com/doncicuto/remix-auth-bitbucket.git","type":"git"},"author":{"name":"Miguel Cabrerizo","email":"doncicuto@gmail.com","url":"https://github.com/doncicuto"},"bugs":{"url":"https://github.com/doncicuto/remix-auth-bitbucket/issues"},"license":"MIT","readme":"# BitbucketStrategy\n\nThe Bitbucket Cloud strategy for [remix-auth](https://github.com/sergiodxa/remix-auth) is used to authenticate users against a Bitbucket Cloud account. It extends the OAuth2Strategy.\n\n## Supported runtimes\n\n| Runtime    | Has Support |\n| ---------- | ----------- |\n| Node.js    | ✅          |\n| Cloudflare | ✅          |\n\n## Usage\n\n### Create an OAuth application\n\nFollow the steps on [the Bitbucket Cloud documentation](https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/) to create a new application and get a client ID and secret.\n\n### Create the strategy instance\n\n```ts\nimport { BitbucketStrategy } from \"remix-auth-bitbucket\";\n\nlet bitbucketStrategy = new BitbucketStrategy(\n  {\n    clientID: \"YOUR_CLIENT_ID\",\n    clientSecret: \"YOUR_CLIENT_SECRET\",\n    callbackURL: \"https://example.com/auth/bitbucket/callback\",\n  },\n  async ({ accessToken, 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(bitbucketStrategy);\n```\n\n### Setup your routes\n\n```tsx\n// app/routes/login.tsx\nexport default function Login() {\n  return (\n    <Form action=\"/auth/bitbucket\" method=\"post\">\n      <button>Login with Bitbucket</button>\n    </Form>\n  );\n}\n```\n\n```tsx\n// app/routes/auth/bitbucket.tsx\nimport { ActionFunction, LoaderFunction, redirect } from \"remix\";\nimport { authenticator } from \"~/auth.server\";\n\nexport let loader: LoaderFunction = () => redirect(\"/login\");\n\nexport let action: ActionFunction = ({ request }) => {\n  return authenticator.authenticate(\"bitbucket\", request);\n};\n```\n\n```tsx\n// app/routes/auth/bitbucket/callback.tsx\nimport { LoaderFunction } from \"remix\";\nimport { authenticator } from \"~/auth.server\";\n\nexport let loader: LoaderFunction = ({ request }) => {\n  return authenticator.authenticate(\"bitbucket\", request, {\n    successRedirect: \"/dashboard\",\n    failureRedirect: \"/login\",\n  });\n};\n```\n\n### Aknowledgements\n\n[@sergiodxa](https://github.com/sergiodxa): for [remix-auth](https://github.com/sergiodxa/remix-auth), [remix-auth-strategy-template](https://github.com/sergiodxa/remix-auth-strategy-template) and for so many repositories and blog posts that make Remix easier to use and learn.\n","readmeFilename":"README.md"}