···11import { Context } from "hono";
22import AccountHandler from "../layout/account";
33+import UsernameField from "../layout/fields/usernameField";
34import FooterCopyright from "../layout/helpers/footer";
45import NavTags from "../layout/helpers/navTags";
56import { TurnstileCaptcha, TurnstileCaptchaPreloads } from "../layout/helpers/turnstile";
67import { BaseLayout } from "../layout/main";
77-import { UsernameField } from "../layout/usernameField";
88import { APP_NAME } from "../siteinfo";
991010export default function ForgotPassword(props:any) {
1111 const ctx: Context = props.c;
1212 const botAccountURL: string = `https://bsky.app/profile/${ctx.env.RESET_BOT_USERNAME}`;
1313- return (
1414- <BaseLayout title="Forgot Password"
1515- preloads={[...TurnstileCaptchaPreloads(ctx)]} noIndex={true}>
1313+ return (<BaseLayout title="Forgot Password"
1414+ preloads={[...TurnstileCaptchaPreloads(ctx)]} noIndex={true}>
1615 <NavTags />
1716 <AccountHandler title="Forgot Password Reset"
1817 submitText={`Request ${APP_NAME} Password Reset`}
···2928 It is <u>heavily recommended</u> to <a href={botAccountURL} target="_blank">follow the service account</a>.<br /><br />
3029 <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>
3130 </center>
3232-3331 <UsernameField />
3434-3532 <TurnstileCaptcha c={ctx} />
3633 </AccountHandler>
3737- </BaseLayout>
3838- );
3434+ </BaseLayout>);
3935}
+18-21
src/pages/login.tsx
···11import AccountHandler from "../layout/account";
22import NavTags from "../layout/helpers/navTags";
33import { BaseLayout } from "../layout/main";
44-import { DashboardPasswordField } from "../layout/passwordFields";
55-import { UsernameField } from "../layout/usernameField";
44+import { DashboardPasswordField } from "../layout/fields/passwordFields";
55+import UsernameField from "../layout/fields/usernameField";
66import { APP_NAME } from "../siteinfo";
77import { PWAutoCompleteSettings } from "../types";
8899export default function Login() {
1010 const links = [{title: "Sign Up", url: "/signup"}, {title: "Forgot Password", url: "/forgot"}];
1111- return (
1212- <BaseLayout title="Login">
1313- <NavTags />
1414- <AccountHandler title="Login"
1515- loadingText="Logging in..."
1616- footerLinks={links}
1717- endpoint="/account/login"
1818- successText="Success! Redirecting to dashboard..."
1919- redirect="/dashboard">
1111+ return (<BaseLayout title="Login">
1212+ <NavTags />
1313+ <AccountHandler title="Login"
1414+ loadingText="Logging in..."
1515+ footerLinks={links}
1616+ endpoint="/account/login"
1717+ successText="Success! Redirecting to dashboard..."
1818+ redirect="/dashboard">
20192121- <UsernameField />
2222-2323- <label hx-history="false">
2424- {APP_NAME} Dashboard Password
2525- <DashboardPasswordField autocomplete={PWAutoCompleteSettings.CurrentPass} required={true} />
2626- <small><b>NOTE</b>: This password is not related to your Bluesky account!</small>
2727- </label>
2828- </AccountHandler>
2929- </BaseLayout>
3030- );
2020+ <UsernameField />
2121+ <label hx-history="false">
2222+ {APP_NAME} Dashboard Password
2323+ <DashboardPasswordField autocomplete={PWAutoCompleteSettings.CurrentPass} required={true} />
2424+ <small><b>NOTE</b>: This password is not related to your Bluesky account!</small>
2525+ </label>
2626+ </AccountHandler>
2727+ </BaseLayout>);
3128}
+35-37
src/pages/signup.tsx
···44import NavTags from "../layout/helpers/navTags";
55import { TurnstileCaptcha, TurnstileCaptchaPreloads } from "../layout/helpers/turnstile";
66import { BaseLayout } from "../layout/main";
77-import { BSkyAppPasswordField, DashboardPasswordField } from "../layout/passwordFields";
88-import { UsernameField } from "../layout/usernameField";
77+import { BSkyAppPasswordField, DashboardPasswordField } from "../layout/fields/passwordFields";
88+import UsernameField from "../layout/fields/usernameField";
99import { MAX_DASHBOARD_PASS, MIN_DASHBOARD_PASS } from "../limits";
1010import { APP_NAME } from "../siteinfo";
1111import { PWAutoCompleteSettings } from "../types";
···1717 (<a href={getInviteThread(ctx)} target="_blank">Invite codes are routinely posted in this thread, grab one here</a>) :
1818 "You can ask for the maintainer for it";
19192020- return (
2121- <BaseLayout title="Signup"
2222- preloads={[...TurnstileCaptchaPreloads(ctx)]}>
2020+ return (<BaseLayout title="Signup"
2121+ preloads={[...TurnstileCaptchaPreloads(ctx)]}>
2322 <NavTags />
2423 <AccountHandler title="Create Account"
2524 submitText="Sign Up!"
···2928 redirect="/login"
3029 footerHTML={<FooterCopyright />}>
31303232- <UsernameField />
3131+ <UsernameField />
33323434- <label hx-history="false">
3535- {APP_NAME} Dashboard Password
3636- <DashboardPasswordField autocomplete={PWAutoCompleteSettings.NewPass} required={true} />
3737- <small>Create a new password to use to login to {APP_NAME}. Passwords should be {MIN_DASHBOARD_PASS} to {MAX_DASHBOARD_PASS} characters long.</small>
3838- </label>
3333+ <label hx-history="false">
3434+ {APP_NAME} Dashboard Password
3535+ <DashboardPasswordField autocomplete={PWAutoCompleteSettings.NewPass} required={true} />
3636+ <small>Create a new password to use to login to {APP_NAME}. Passwords should be {MIN_DASHBOARD_PASS} to {MAX_DASHBOARD_PASS} characters long.</small>
3737+ </label>
39383939+ <label>
4040+ Bluesky App Password
4141+ <BSkyAppPasswordField required={true} />
4242+ <small>
4343+ If you need a BlueSky app password for your account, <a target="_blank" href="https://bsky.app/settings/app-passwords">you can get one here</a>.<br />
4444+ If you use a separate PDS, you can change that in "Account Settings" on your dashboard, the site will attempt to infer your PDS for you.
4545+ </small>
4646+ </label>
4747+4848+ {isUsingInviteKeys(ctx) ? (
4049 <label>
4141- Bluesky App Password
4242- <BSkyAppPasswordField required={true} />
4343- <small>
4444- If you need a BlueSky app password for your account, <a target="_blank" href="https://bsky.app/settings/app-passwords">you can get one here</a>.<br />
4545- If you use a separate PDS, you can change that in "Account Settings" on your dashboard, the site will attempt to infer your PDS for you.
4646- </small>
5050+ {APP_NAME} Invite Key/Signup Token
5151+ <input type="text" name="signupToken" placeholder="" required />
5252+ <small>This is an invite key to try to dissuade bots/automated applications. {linkToInvites}.</small>
4753 </label>
4848-4949- {isUsingInviteKeys(ctx) ? (
5050- <label>
5151- {APP_NAME} Invite Key/Signup Token
5252- <input type="text" name="signupToken" placeholder="" required />
5353- <small>This is an invite key to try to dissuade bots/automated applications. {linkToInvites}.</small>
5454- </label>
5555- ) : ''}
5454+ ) : ''}
56555757- <hr />
5858- <fieldset>
5959- <legend><label for="agreeTerms">Agree to {APP_NAME} Terms</label></legend>
6060- <input id="agreeTerms" type="checkbox" name="agreeTerms" />
6161- Check the box if you agree to {APP_NAME}'s <a href="/privacy" class="secondary" target="_blank" title="link to privacy policy">privacy policy
6262- </a> and <a href="/tos" class="secondary" target="_blank" title="link to terms of service">terms of service</a>.
6363- </fieldset>
6464- <br />
6565- <TurnstileCaptcha c={ctx} />
6666- </AccountHandler>
6767- </BaseLayout>
6868- );
5656+ <hr />
5757+ <fieldset>
5858+ <legend><label for="agreeTerms">Agree to {APP_NAME} Terms</label></legend>
5959+ <input id="agreeTerms" type="checkbox" name="agreeTerms" />
6060+ Check the box if you agree to {APP_NAME}'s <a href="/privacy" class="secondary" target="_blank" title="link to privacy policy">privacy policy
6161+ </a> and <a href="/tos" class="secondary" target="_blank" title="link to terms of service">terms of service</a>.
6262+ </fieldset>
6363+ <br />
6464+ <TurnstileCaptcha c={ctx} />
6565+ </AccountHandler>
6666+ </BaseLayout>);
6967}