Skip to content

Commit

Permalink
v0.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
cletqui committed Jul 4, 2024
1 parent 4fec349 commit 96b5638
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ npm run deploy
- [x] Cloudflare
- [ ] GitHub
- [ ] Heroku
- [ ] Implement fine-grained tokens for GitHub apps (instead of global access_token)
- [ ] Use middlewares
- [ ] to declare the octokit instance
- [x] to add auth header if access_token is valid (to allow API use when `access_token` is defined)
- [x] fix API by adding 404 not found if no repo by id is found
- [x] Add icons in footer
- [x] Find `MAX_ID` dynamically and store in Cookies
Expand All @@ -65,3 +61,6 @@ npm run deploy
- [x] change GitHub App icon
- [x] handle `state` verification
- [x] handle `access_token` refresh with `refresh_token`
- [x] Use middlewares
- [x] to declare the octokit instance
- [x] to add auth header if access_token is valid (to allow API use when `access_token` is defined)
2 changes: 0 additions & 2 deletions src/utils/octokit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export const apiAuth = createMiddleware(
c: Context<{ Bindings: Bindings; Variables: Variables }>,
next: Next
) => {
console.log("MIDDLEWARE", "apiAuth");
const { access_token } = c.var;
const accessToken = access_token || c.req.header("Authorization");
if (accessToken && (await verifyToken(accessToken, c))) {
Expand All @@ -61,7 +60,6 @@ export const handleOctokit = createMiddleware(
c: Context<{ Bindings: Bindings; Variables: Variables }>,
next: Next
) => {
console.log("MIDDLEWARE", "handleOctokit");
const octokit = getOctokitInstance(c);
c.set("octokit", octokit);
await next();
Expand Down
2 changes: 0 additions & 2 deletions src/utils/state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export const generateState = createMiddleware(
c: Context<{ Bindings: Bindings; Variables: Variables }>,
next: Next
) => {
console.log("MIDDLEWARE", "generateState");
const state = generateRandomString();
setCookie(c, "state", state, {
path: "/github",
Expand All @@ -44,7 +43,6 @@ export const handleState = createMiddleware(
c: Context<{ Bindings: Bindings; Variables: Variables }>,
next: Next
): Promise<Response | void> => {
console.log("MIDDLEWARE", "handleState");
const secret = getCookie(c, "state", "secure");
const { state } = c.req.query();
if (secret === state) {
Expand Down

0 comments on commit 96b5638

Please sign in to comment.