Skip to content

Allow OAuth2 bearer tokens to be used if used explicitly #215

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

Merged

Conversation

yutotakano
Copy link
Member

Fixes #213 by allowing the library user to explicitly specify the token type if they wish to do so.

I.E., authToken previously worked as follows:

  • Prefix input with "Bot "

Now, authToken works as follows:

  • If there is already a prefix in the input, e.g. "Bearer " or "Bot ", use it
  • Otherwise, prefix input with "Bot "

I've documented the two types of tokens briefly, but a more in-depth explanation may need to be added somewhere more visible (e.g. in the README or somewhere linked from it), see #213 (comment) for more info.

@L0neGamer L0neGamer merged commit 3e09c5b into discord-haskell:master Jan 9, 2025
7 checks passed
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.

How to use OAuth2 tokens with UserRequest endpoints?
2 participants