Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
fix: wrong parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
cinlk committed Mar 24, 2022
1 parent 3dad794 commit ffb2884
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion airdrop/api/pangolin/airdrop/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default async function (req: VercelRequest, res: VercelResponse) {
let user;
try {
const cookies = req.cookies;
const accessToken = cookies['x-access-token'];
const accessToken = cookies['x-access-pangolin-token'];
const octokit = new Octokit({
auth: accessToken,
});
Expand Down
2 changes: 1 addition & 1 deletion airdrop/api/pangolin/airdrop/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default async function (req: VercelRequest, res: VercelResponse) {
let user;
try {
const cookies = req.cookies;
const accessToken = cookies['x-access-token'];
const accessToken = cookies['x-access-pangolin-token'];
const octokit = new Octokit({
auth: accessToken,
});
Expand Down
2 changes: 1 addition & 1 deletion airdrop/api/pangolin/authorization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default async function (req: VercelRequest, res: VercelResponse) {
res.statusCode = 302;
const auth = qs.parse(req.query);
const accessToken = auth.access_token;
res.setHeader('Set-Cookie', `x-access-token=${accessToken};httpOnly;secure;path=/;`);
res.setHeader('Set-Cookie', `x-access-pangolin-token=${accessToken};httpOnly;secure;path=/;`);
res.setHeader('Location', '/evm-compatible-crab-smart-chain/get-started/darwinia-pangolin?oauth=github#get-tokens');
res.end('Redirect /evm-compatible-crab-smart-chain/get-started/darwinia-pangolin?oauth=github#get-tokens');

Expand Down
4 changes: 2 additions & 2 deletions airdrop/api/pangolin/grant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const grant = require('grant').vercel({

function grantConfig() {
const config = require('./config/grant.json');
config.github.key = process.env.GITHUB_OAUTH_APP_KEY;
config.github.secret = process.env.GITHUB_OAUTH_APP_SECRET;
config.github.key = process.env.PANGOLIN_GITHUB_OAUTH_APP_KEY;
config.github.secret = process.env.PANGOLIN_GITHUB_OAUTH_APP_SECRET;
return config;
}

Expand Down
2 changes: 1 addition & 1 deletion airdrop/api/pangolin/user/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default async function (req: VercelRequest, res: VercelResponse) {
async function queryGithubAccountInfo(req: VercelRequest): Promise<UserInfo | null> {
try {
const cookies = req.cookies;
const accessToken = cookies['x-access-token'];
const accessToken = cookies['x-access-pangolin-token'];
const octokit = new Octokit({
auth: accessToken,
});
Expand Down

0 comments on commit ffb2884

Please sign in to comment.