Commit 20394369 authored by Grant's avatar Grant
Browse files

add friendly error messages to fallback auth

parent f9be34a2
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -199,6 +199,31 @@ export default function LoginPage({
            <Stack direction="column" gap={1} sx={{ mt: 1 }}>
              {errors.map(({ code, meta }) => {
                switch (code) {
                  case "failed_to_find_user":
                    return (
                      <Alert key={code} severity="error">
                        <b>Failed to find user</b>
                        <br />
                        {/* TODO: remove hardcoded instance */}
                        Your instance may not be federated with grants.cafe,
                        unable to verify.
                      </Alert>
                    );
                  case "no_mentions":
                    return (
                      <Alert key={code} severity="info">
                        <b>No mentions, yet</b>
                        <br />
                        Make sure you make a post that the account can see
                      </Alert>
                    );
                  case "message_content_invalid":
                    return (
                      <Alert key={code} severity="warning">
                        <b>Message content isn&apos;t the expected</b> Make sure
                        the post content is what is below
                      </Alert>
                    );
                  case "no_polyfill":
                    return (
                      <Alert key={code} severity="error">