Schedule posts to Bluesky with Cloudflare workers. skyscheduler.work
cf tool bsky-tool cloudflare bluesky schedule bsky service social-media cloudflare-workers
at main 35 lines 2.1 kB view raw
1import { Context } from "hono"; 2import AccountHandler from "../layout/account"; 3import UsernameField from "../layout/fields/usernameField"; 4import FooterCopyright from "../layout/helpers/footer"; 5import NavTags from "../layout/helpers/navTags"; 6import { TurnstileCaptcha, TurnstileCaptchaPreloads } from "../layout/helpers/turnstile"; 7import { BaseLayout } from "../layout/main"; 8import { APP_NAME } from "../siteinfo"; 9 10export default function ForgotPassword(props:any) { 11 const ctx: Context = props.c; 12 const botAccountURL: string = `https://bsky.app/profile/${ctx.env.RESET_BOT_USERNAME}`; 13 return (<BaseLayout title="Forgot Password" 14 preloads={[...TurnstileCaptchaPreloads(ctx)]} noIndex={true}> 15 <NavTags /> 16 <AccountHandler title="Forgot Password Reset" 17 submitText={`Request ${APP_NAME} Password Reset`} 18 loadingText="Requesting Password Reset..." endpoint="/account/forgot" 19 successText="Attempted to send DM. If you do not have it, please make sure you are following the account." 20 redirect="/login" 21 customRedirectDelay={2000} 22 footerHTML={<FooterCopyright />}> 23 24 <center hx-history="false"> 25 <p>You will receive a <a target="_blank" href="https://bsky.app/messages">Direct Message</a> from <code>@{ctx.env.RESET_BOT_USERNAME}</code> on BSky/PDS with a link to reset your password.<br /> 26 If you encounter errors, your <a href="https://bsky.app/messages/settings" class="secondary" rel="nofollow" target="_blank">Direct Communication settings</a> might be set to forbid 27 Direct Messages from accounts you don't follow.<br /><br /> 28 It is <u>heavily recommended</u> to <a href={botAccountURL} target="_blank">follow the service account</a>.<br /><br /> 29 <small><b>NOTE</b>: {APP_NAME} sends DMs via an one-way delivery method. No one (other than you) can see the account password reset URL.</small></p> 30 </center> 31 <UsernameField /> 32 <TurnstileCaptcha c={ctx} /> 33 </AccountHandler> 34 </BaseLayout>); 35}