Skip to content

Commit

Permalink
change to header auth token
Browse files Browse the repository at this point in the history
  • Loading branch information
Primata committed Aug 6, 2024
1 parent fd2503a commit 6a26a9c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/rate-limit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,18 @@ export default async function handler(request: any, response: any) {
if (!success) {
return response.status(429).json({success: false, error: "Rate limited"});
}

const HEADERS: Record<string, string | number | boolean> = {
Authorization: `Bearer ${process.env.FAUCET_AUTH_TOKEN}`
};
const aptos = new Aptos(
new AptosConfig({
fullnode: "https://aptos.testnet.suzuka.movementlabs.xyz/v1",
faucet: "https://faucet.testnet.suzuka.movementlabs.xyz",
faucetConfig: {AUTH_TOKEN: process.env.FAUCET_AUTH_TOKEN},
faucetConfig: {HEADERS: HEADERS},
}),
);

const fund = await aptos.fundAccount({
accountAddress: address,
amount: 1000000000,
Expand Down

0 comments on commit 6a26a9c

Please sign in to comment.