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

Commit

Permalink
fix: build fail
Browse files Browse the repository at this point in the history
  • Loading branch information
JayJay1024 committed Mar 24, 2022
1 parent 73957b7 commit e51f70a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
21 changes: 0 additions & 21 deletions airdrop/api/grant.json

This file was deleted.

31 changes: 26 additions & 5 deletions airdrop/api/grant.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
import type { VercelRequest, VercelResponse } from '@vercel/node';

const grant = require('grant').vercel({
config: grantConfig(), session: {secret: 'grant'}
});

function grantConfig() {
const config = require('./config/grant.json');
const config = {
"defaults": {
// "origin": "https://docs.crab.network",
"origin": "https://crab-docs-dev.vercel.app",
"transport": "querystring",
"state": true
},
"github": {
"key": "{{ github_oauth_app_key }}",
"secret": "{{ github_oauth_app_secret }}",
"scope": [],
"callback": "/api/crab/authorization",
"overrides": {
"crab": {
"callback": "/api/crab/authorization"
},
"pangolin": {
"callback": "/api/pangolin/authorization"
}
}
}
};
config.github.key = process.env.GITHUB_OAUTH_APP_KEY;
config.github.secret = process.env.GITHUB_OAUTH_APP_SECRET;
return config;
}

const grant = require('grant').vercel({
config: grantConfig(), session: {secret: 'grant'}
});

export default async function (req: VercelRequest, res: VercelResponse) {
await grant(req, res)
}

0 comments on commit e51f70a

Please sign in to comment.