{"id":25718983,"url":"https://github.com/byeseechairten/payload-magic-login","last_synced_at":"2026-02-19T11:34:31.888Z","repository":{"id":219199889,"uuid":"748450764","full_name":"ByeSeeChairTen/payload-magic-login","owner":"ByeSeeChairTen","description":"A payloadcms plugin (v2) for implementing the passport-magic-login strategy.","archived":false,"fork":false,"pushed_at":"2024-02-05T10:01:20.000Z","size":451,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T08:18:30.623Z","etag":null,"topics":["payload-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/payload-magic-login","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ByeSeeChairTen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-01-26T01:47:34.000Z","updated_at":"2025-03-04T04:36:52.000Z","dependencies_parsed_at":"2024-02-05T11:22:43.526Z","dependency_job_id":null,"html_url":"https://github.com/ByeSeeChairTen/payload-magic-login","commit_stats":null,"previous_names":["byeseechairten/payload-magic-login"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ByeSeeChairTen/payload-magic-login","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByeSeeChairTen%2Fpayload-magic-login","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByeSeeChairTen%2Fpayload-magic-login/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByeSeeChairTen%2Fpayload-magic-login/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByeSeeChairTen%2Fpayload-magic-login/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ByeSeeChairTen","download_url":"https://codeload.github.com/ByeSeeChairTen/payload-magic-login/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ByeSeeChairTen%2Fpayload-magic-login/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272659284,"owners_count":24971607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["payload-plugin"],"created_at":"2025-02-25T16:27:34.403Z","updated_at":"2026-02-19T11:34:31.845Z","avatar_url":"https://github.com/ByeSeeChairTen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Payload Magic Login Plugin\n\n## THIS IS A PACKAGE UNDER ACTIVE DEVELOPMENT - USE AT YOUR OWN RISK\n\nThis is built with the [Payload CMS](https://payloadcms.com) plugin template.\n\n### How to install this plugin\n\nFirst install it with `npm install payload-magic-login` (or your preferred package manager).\n\nTo then install this plugin, simply add it to your payload.config() in the Plugin array.\n\n```ts\nimport magicLoginPlugin from 'payload-magic-login';\n\nexport const config = buildConfig({\n  plugins: [\n    // You can pass options to the plugin\n    magicLoginPlugin({\n      secret: process.env.PAYLOAD_SECRET, // A secret used to sign the JWTs\n      payload: payload, // Your payload instance\n      enabled: true, \n      targets: [\n         {\n          target: \"app-dev\",\n          uri: \"exp://my-app-dev.exp.direct\",\n          subject: \"GetRekd: Login Link\",\n          html: (link) =\u003e `Click this link to finish logging in: \u003ca href=\"${link}\"\u003eLOGIN LINK\u003c/a\u003e, if you can't click the link, copy and paste this link into your browser: \\n\\n${link}`\n        },\n      ]\n    })\n  ]\n});\n```\n\n#### It depends on these things in your config:\n\n```ts\n  // payload.config.ts\n  ...\n  email: {\n    fromName: 'Oscar - GetRekd app',\n    fromAddress: 'oscar@getrekd.lol',\n    // You can use the ethereal mail in dev, \n    // but requires some sort of transport options for actual emails (See Payload Docs)\n    transportOptions: {\n      host: process.env.SMTP_HOST,\n      auth: {\n        user: process.env.SMTP_USER,\n        pass: process.env.SMTP_PASS,\n      },\n      port: process.env.SMTP_PORT,\n      secure: Number(process.env.SMTP_SECURE) === 465,\n      requireTLS: Number(process.env.SMTP_SECURE) === 587,\n    }\n  },\n  // It will redirect to this URL\n  serverURL: process.env.SERVER_URL || 'http://localhost:3000',\n  ...\n```\n\n#### Things to consider\n\nAt this moment, it creates a user collection for you - with an email and salt/hash (plan is to support this alongside local auth, working on that).\nI will add support to extend this or have it update the given collection at a later date.\n\n#### Example\n\nIn the dev folder, you’ll find a basic payload project, created with `npx create-payload-app`.\n\nThe `magicLoginPlugin` has already been installed to the `payload.config()` file in this project.\n\n```ts\nplugins: [\n  magicLoginPlugin({\n      secret: process.env.PAYLOAD_SECRET, // A secret used to sign the JWTs\n      payload: payload, // Your payload instance\n      enabled: true, \n      // Targets are used to determine where the link should point to.\n      // For example: target: \"admin\" (default) creates a link to the admin panel.\n      // The targets \"app\" and \"app-dev\" could be for opening the link in an app.\n      targets: [\n        {\n          target: \"app\",\n          uri: \"exp://my-app.exp.direct\",\n          subject: \"GetRekd: Login Link\",\n          html: (link) =\u003e `Click this link to finish logging in: \u003ca href=\"${link}\"\u003eLOGIN LINK\u003c/a\u003e, if you can't click the link, copy and paste this link into your browser: ${link}`\n        },\n        {\n          target: \"app-dev\",\n          uri: \"exp://my-app-dev.exp.direct\",\n          subject: \"GetRekd: Login Link\",\n          html: (link) =\u003e `Click this link to finish logging in: \u003ca href=\"${link}\"\u003eLOGIN LINK\u003c/a\u003e, if you can't click the link, copy and paste this link into your browser: \\n\\n${link}`\n        },\n      ]\n    })\n]\n```\n\nWhen you’re ready to start development, navigate into this folder with `cd dev`\n\nAnd then start the project with `yarn dev` and pull up [http://localhost:3000/](http://localhost:3000/) in your browser.\n\n\n##### Types.ts\n\nThese are the current types/options for the plugin.\n\n```ts\nexport interface PluginTypes {\n  /**\n   * Enable or disable plugin\n   * @default false\n   */\n  enabled?: boolean\n  /**\n   * Secret used to sign JWTs\n   */\n  secret: string\n  /**\n   * The payload instance\n   * @default payload\n   */\n  payload: Payload\n  /**\n   * Your own custom targets:\n   * @default []\n   * @example\n   * targets: [\n   *  { \n   *   target: \"app\",\n   *   uri: \"exp://my-app.example.com\",\n   *   subject: \"GetRekd: Login Link\",\n   *   html: `Click this link to finish logging in: \u003ca href=\"${link}\"\u003eLOGIN LINK\u003c/a\u003e, if you can't click the link, copy and paste this link into your browser: ${link}`\n   *  },\n   *  {\n   *   target: \"admin\",\n   *   uri: \"https://admin.getrekd.lol\",\n   *   subject: \"GetRekd: Login Link\",\n   *   html: `Click this link to finish logging in: \u003ca href=\"${link}\"\u003eLOGIN LINK\u003c/a\u003e, if you can't click the link, copy and paste this link into your browser: ${link}`\n   *  }\n   * ]\n   */\n  `targets?: Array\u003c{ target: string, uri: string, subject: string, html: (link: string) =\u003e string }\u003e`\n}\n```\n\n##### Testing\n\nI will implement tests shortlyTM.\n\n\n### Contribute\n\nFeel free to submit PRs and suggestions, the code isn't perfect by any means and is provided as-is. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyeseechairten%2Fpayload-magic-login","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyeseechairten%2Fpayload-magic-login","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyeseechairten%2Fpayload-magic-login/lists"}