-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from oxen-io/improved_faucet
Session Token Testnet Faucet
- Loading branch information
Showing
40 changed files
with
1,960 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,9 @@ yarn-error.log* | |
# Misc | ||
.DS_Store | ||
*.pem | ||
.cache | ||
.cache | ||
|
||
# Databases | ||
*.sqlite | ||
*.sqlite3 | ||
*.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID= | ||
NEXT_PUBLIC_SENT_STAKING_API_URL= | ||
FAUCET_WALLET_PRIVATE_KEY= | ||
NEXT_PUBLIC_ENV_FLAG= pick from dev, qa, stg, prd | ||
FAUCET_DB_SECRET_KEY= | ||
FAUCET_HOURS_BETWEEN_USES= | ||
FAUCET_CHAIN=testnet | ||
NEXT_PUBLIC_ENV_FLAG= pick from dev, qa, stg, prd | ||
DISCORD_CLIENT_ID= | ||
DISCORD_CLIENT_SECRET= | ||
TELEGRAM_BOT_TOKEN= | ||
NEXTAUTH_SECRET= | ||
NEXTAUTH_URL= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { createAuthHandler } from '@session/auth/api'; | ||
import { DiscordProvider, handleDiscordSession } from '@session/auth/providers/discord'; | ||
import { TelegramProvider, handleTelegramSession } from '@session/auth/providers/telegram'; | ||
|
||
const discordClientId = process.env.DISCORD_CLIENT_ID; | ||
const discordClientSecret = process.env.DISCORD_CLIENT_SECRET; | ||
const telegramBotToken = process.env.TELEGRAM_BOT_TOKEN; | ||
|
||
if (!discordClientId || !discordClientSecret) { | ||
throw new Error('Discord client ID and client secret must be provided'); | ||
} | ||
|
||
if (!telegramBotToken) { | ||
throw new Error('Telegram bot token must be provided'); | ||
} | ||
|
||
export const { GET, POST } = createAuthHandler({ | ||
providers: [ | ||
DiscordProvider({ | ||
clientId: discordClientId, | ||
clientSecret: discordClientSecret, | ||
}), | ||
TelegramProvider({ botToken: telegramBotToken }), | ||
], | ||
callbacks: { | ||
async session({ session, token }) { | ||
handleDiscordSession({ session, token }); | ||
handleTelegramSession({ session, token }); | ||
return session; | ||
}, | ||
}, | ||
}); |
Oops, something went wrong.