Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Slack Adapter #101

Merged
merged 6 commits into from
Dec 26, 2024

Conversation

jonathanbecerra
Copy link
Contributor

Added Slack Adapter

  • Slack Authentication: Integrated a Slack adapter using https://api.slack.com/authentication/sign-in-with-slack as the source for the required endpoints.

  • Scope Type: Introduced a scoped type, Scope, using a union for type safety.

    • I would like to suggest a top-level union of common scopes and append provider-specific scopes using utilities like Exclude or Extract to limit scopes as necessary. e.g:
    // scopes.ts
    type Scope = "openid" | "email"
    
    // slack.ts
    // Use the top level union plus the provider's set of scopes.
    type SlackScope = Scope | "profile"
    // Alternatively, to exclude "email" from Slack scopes:
    type SlackScope = Exclude<Scope, "email"> | "profile"
    // Another option is to extract only specific members from the top-level union:
    type SlackScope = Extract<Scope, "openid" | "email">;

UI Updates

  • Slack Icon: Added ICON_SLACK to the ui/icon.tsx file in black and white, aligning with the style of other icons. While this addition follows existing conventions, we can revise or remove it if not necessary.

Copy link

changeset-bot bot commented Dec 21, 2024

🦋 Changeset detected

Latest commit: 6f43b5d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@openauthjs/openauth Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@thdxr thdxr merged commit d8d1580 into toolbeam:master Dec 26, 2024
jayair pushed a commit that referenced this pull request Jan 1, 2025
* feat: add Slack OAuth2 adapter with configuration and scopes

* added: Imported slack's svg into the icon.tsx in case this is used similar to the gh and google icons.

* fix: update Slack icon colors to use currentColor as per the other components.

* Add slack adapter to the list of available adapters.

* refactored: Removed s, no need for plural.

* fix: update comment to suggest using Extract or Exclude for scope constraints as per the PR, utility types can get mixed up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants