Skip to content

Commit

Permalink
fix: trim token
Browse files Browse the repository at this point in the history
  • Loading branch information
Qu4k committed Aug 30, 2020
1 parent 1db2bb6 commit 8e4a507
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plugins/github/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const reToken = /^\w+$/;

export async function verifyToken(token: string): Promise<Response> {
if (!token) return { ok: false, err: "Empty token" };
token = token.trim();
if (!reToken.test(token)) return { ok: false, err: "Malformed token" };
const res = await fetch(BASE, {
headers: {
Expand Down

0 comments on commit 8e4a507

Please sign in to comment.