From cb4d41d1fe218f63e097260be2fb539db834bb53 Mon Sep 17 00:00:00 2001 From: Neo Date: Mon, 27 Oct 2025 20:31:11 +0000 Subject: [PATCH 1/4] feat(provider): add Paybin provider - Add Paybin OIDC provider with issuer at idp.paybin.io - Include comprehensive JSDoc documentation - Add provider logo and documentation page - Update manifest and issue templates --- .github/ISSUE_TEMPLATE/2_bug_provider.yml | 1 + docs/pages/data/manifest.json | 1 + .../getting-started/providers/paybin.mdx | 83 ++++++++++++++++ docs/public/img/providers/paybin.svg | 9 ++ packages/core/src/providers/paybin.ts | 94 +++++++++++++++++++ 5 files changed, 188 insertions(+) create mode 100644 docs/pages/getting-started/providers/paybin.mdx create mode 100644 docs/public/img/providers/paybin.svg create mode 100644 packages/core/src/providers/paybin.ts diff --git a/.github/ISSUE_TEMPLATE/2_bug_provider.yml b/.github/ISSUE_TEMPLATE/2_bug_provider.yml index 1ee4409a23..9d079ec97b 100644 --- a/.github/ISSUE_TEMPLATE/2_bug_provider.yml +++ b/.github/ISSUE_TEMPLATE/2_bug_provider.yml @@ -82,6 +82,7 @@ body: - "Osso" - "Osu" - "Patreon" + - "Paybin" - "Ping Identity" - "Pipedrive" - "Reddit" diff --git a/docs/pages/data/manifest.json b/docs/pages/data/manifest.json index 7fef03e029..3fcc9ca85b 100644 --- a/docs/pages/data/manifest.json +++ b/docs/pages/data/manifest.json @@ -102,6 +102,7 @@ "osu": "Osu!", "passage": "Passage", "patreon": "Patreon", + "paybin": "Paybin", "pinterest": "Pinterest", "pipedrive": "Pipedrive", "reddit": "Reddit", diff --git a/docs/pages/getting-started/providers/paybin.mdx b/docs/pages/getting-started/providers/paybin.mdx new file mode 100644 index 0000000000..a4f4d4f280 --- /dev/null +++ b/docs/pages/getting-started/providers/paybin.mdx @@ -0,0 +1,83 @@ +import { Callout } from "nextra/components" +import { Code } from "@/components/Code" + + + +# Paybin Provider + +## Resources + +- [Paybin OAuth documentation](https://paybin.io/docs/oauth) +- [Paybin OIDC configuration](https://idp.paybin.io/.well-known/openid-configuration) + +## Setup + +### Callback URL + + + + + ```bash + https://example.com/api/auth/callback/paybin + ``` + + + + + ```bash + https://example.com/auth/callback/paybin + ``` + + + + +### Environment Variables + +``` +AUTH_PAYBIN_ID +AUTH_PAYBIN_SECRET +``` + +### Configuration + + + + +```ts filename="/auth.ts" +import NextAuth from "next-auth" +import Paybin from "next-auth/providers/paybin" + +export const { handlers, auth, signIn, signOut } = NextAuth({ + providers: [Paybin], +}) +``` + + + + +```ts filename="/src/auth.ts" +import { SvelteKitAuth } from "@auth/sveltekit" +import Paybin from "@auth/sveltekit/providers/paybin" + +export const { handle, signIn, signOut } = SvelteKitAuth({ + providers: [Paybin], +}) +``` + + + + +```ts filename="/src/app.ts" +import { ExpressAuth } from "@auth/express" +import Paybin from "@auth/express/providers/paybin" + +app.use("/auth/*", ExpressAuth({ providers: [Paybin] })) +``` + + + + + + By default, Auth.js assumes that the Paybin provider is based on the + [OIDC](https://openid.net/specs/openid-connect-core-1_0.html) specification. + diff --git a/docs/public/img/providers/paybin.svg b/docs/public/img/providers/paybin.svg new file mode 100644 index 0000000000..ed26d344ed --- /dev/null +++ b/docs/public/img/providers/paybin.svg @@ -0,0 +1,9 @@ + + path d="M22.6515 6.79091H24.9212C26.1696 6.79091 27.1909 7.81296 27.1909 9.06212V11.3333C27.1909 12.5825 26.1696 13.6045 24.9212 13.6045H22.6515C21.4032 13.6045 20.3818 12.5825 20.3818 11.3333V9.06212C20.3818 7.81296 21.4032 6.79091 22.6515 6.79091Z" fill="#BCF42E"> + \ No newline at end of file diff --git a/packages/core/src/providers/paybin.ts b/packages/core/src/providers/paybin.ts new file mode 100644 index 0000000000..5e56dd4703 --- /dev/null +++ b/packages/core/src/providers/paybin.ts @@ -0,0 +1,94 @@ +/** + *
+ * + * Built-in sign in with Paybin integration. + * + * + * + * + *
+ * + * @module providers/paybin + */ +import type { OIDCConfig, OIDCUserConfig } from "./index.js" + +/** + * The returned user profile from Paybin when using the profile callback. + * [Reference](https://idp.paybin.io/.well-known/openid-configuration) + */ +export interface PaybinProfile extends Record { + /** The user's unique identifier. */ + sub: string + /** The user's email address. */ + email: string + /** Indicates whether the user has verified their email address. */ + email_verified?: boolean + /** The user's full name. */ + name?: string + /** The user's username. */ + preferred_username?: string + /** URL pointing to the user's profile picture. */ + picture?: string + /** The user's given name. */ + given_name?: string + /** The user's family name. */ + family_name?: string +} + +/** + * ### Setup + * + * #### Callback URL + * ``` + * https://example.com/api/auth/callback/paybin + * ``` + * + * #### Configuration + * ```ts + * import { Auth } from "@auth/core" + * import Paybin from "@auth/core/providers/paybin" + * + * const request = new Request(origin) + * const response = await Auth(request, { + * providers: [ + * Paybin({ + * clientId: PAYBIN_CLIENT_ID, + * clientSecret: PAYBIN_CLIENT_SECRET, + * }), + * ], + * }) + * ``` + * + * ### Resources + * + * - [Paybin OAuth documentation](https://developers.paybin.io/knowledge-center/oidc) + * - [Paybin OIDC configuration](https://idp.paybin.io/.well-known/openid-configuration) + * + * ### Notes + * + * By default, Auth.js assumes that the Paybin provider is + * based on the [Open ID Connect](https://openid.net/specs/openid-connect-core-1_0.html) specification. + * + * The Paybin provider comes with a [default configuration](https://github.com/nextauthjs/next-auth/blob/main/packages/core/src/providers/paybin.ts). + * To override the defaults for your use case, check out [customizing a built-in OAuth provider](https://authjs.dev/guides/configuring-oauth-providers). + * + * ## Help + * + * If you think you found a bug in the default configuration, you can [open an issue](https://authjs.dev/new/provider-issue). + * + * Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from + * the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, + * we might not pursue a resolution. You can ask for more help in [Discussions](https://authjs.dev/new/github-discussions). + */ +export default function Paybin

( + options: OIDCUserConfig

+): OIDCConfig

{ + return { + id: "paybin", + name: "Paybin", + type: "oidc", + issuer: "https://idp.paybin.io", + style: { text: "#fff", bg: "#000" }, + options, + } +} From 60aa6961ed8315c54b132679b857763147a46aa2 Mon Sep 17 00:00:00 2001 From: Neo Date: Mon, 27 Oct 2025 21:18:24 +0000 Subject: [PATCH 2/4] fix: optimize Paybin provider SVG icon --- docs/public/img/providers/paybin.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/public/img/providers/paybin.svg b/docs/public/img/providers/paybin.svg index ed26d344ed..0b0b01958c 100644 --- a/docs/public/img/providers/paybin.svg +++ b/docs/public/img/providers/paybin.svg @@ -5,5 +5,5 @@ viewBox="0 0 122 34" fill="none" > - path d="M22.6515 6.79091H24.9212C26.1696 6.79091 27.1909 7.81296 27.1909 9.06212V11.3333C27.1909 12.5825 26.1696 13.6045 24.9212 13.6045H22.6515C21.4032 13.6045 20.3818 12.5825 20.3818 11.3333V9.06212C20.3818 7.81296 21.4032 6.79091 22.6515 6.79091Z" fill="#BCF42E"> + \ No newline at end of file From 3587773b2e00a86375047025b025b38923716c00 Mon Sep 17 00:00:00 2001 From: Neo Date: Mon, 27 Oct 2025 21:23:59 +0000 Subject: [PATCH 3/4] fix: correct SVG syntax for Paybin provider icon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed malformed closing tags in SVG paths 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- docs/public/img/providers/paybin.svg | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/public/img/providers/paybin.svg b/docs/public/img/providers/paybin.svg index 0b0b01958c..a21c96c750 100644 --- a/docs/public/img/providers/paybin.svg +++ b/docs/public/img/providers/paybin.svg @@ -5,5 +5,23 @@ viewBox="0 0 122 34" fill="none" > - + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 8c50b05c13d206d64a260fa65d60f86488238d6a Mon Sep 17 00:00:00 2001 From: Neo Date: Mon, 27 Oct 2025 21:26:47 +0000 Subject: [PATCH 4/4] refactor: make Paybin SVG responsive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove fixed width/height attributes to allow responsive scaling 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- docs/public/img/providers/paybin.svg | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/docs/public/img/providers/paybin.svg b/docs/public/img/providers/paybin.svg index a21c96c750..00961a48c3 100644 --- a/docs/public/img/providers/paybin.svg +++ b/docs/public/img/providers/paybin.svg @@ -1,10 +1,4 @@ - +