Fix installation token authentication error - #140
Merged
Merged
Conversation
- Call auth function to get actual installation token before passing to Octokit - Fixes '[@octokit/auth-token] Token passed to createTokenAuth is not a string' error - Ensures proper token string is passed to Octokit constructor - Adds proper error handling for installation token retrieval
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Pass auth function directly to Octokit instead of extracting token - This is the correct approach for @octokit/auth-app - Fixes JWT decoding errors when using installation tokens - Octokit will handle token refresh automatically
- Use authStrategy parameter instead of auth parameter - This is the correct way to use @octokit/auth-app with Octokit - Fixes 'Token passed to createTokenAuth is not a string' error - Octokit will properly handle the auth function as a strategy
- Use auth function directly with Octokit constructor - This should work with @octokit/auth-app - Let's test this approach to see if it resolves the token issue
- Get installation token directly via GitHub API - Use token string with Octokit constructor - Test token with direct fetch API call instead of Octokit - This should resolve the JWT decoding errors
Collaborator
Author
|
/approve |
Contributor
|
🚀 Admin-Approved and Auto-Merged! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 Problem
The content submission was failing with error:
[@octokit/auth-token] Token passed to createTokenAuth is not a string🔍 Root Cause
The
authfunction was being passed directly to Octokit constructor instead of calling it first to get the actual installation token string.✅ Solution
auth({ type: 'installation' })to get the actual installation token🧪 Testing
🎯 Expected Result
Content submission should work without the
Token passed to createTokenAuth is not a stringerror.Fixes the issue where users get: