Merge branch '895' of github.com:omnivore-app/omnivore into 895
This commit is contained in:
@ -356,6 +356,11 @@ export function authRouter() {
|
||||
cors<express.Request>(corsConfig),
|
||||
async (req: express.Request, res: express.Response) => {
|
||||
const { email, password } = req.body
|
||||
if (!email || !password) {
|
||||
res.redirect(`${env.client.url}/email-login?errorCodes=AUTH_FAILED`)
|
||||
return
|
||||
}
|
||||
|
||||
const query = `
|
||||
mutation login{
|
||||
login(input: {
|
||||
@ -418,6 +423,11 @@ export function authRouter() {
|
||||
cors<express.Request>(corsConfig),
|
||||
async (req: express.Request, res: express.Response) => {
|
||||
const { email, password, name, username, bio } = req.body
|
||||
if (!email || !password || !name || !username) {
|
||||
res.redirect(`${env.client.url}/email-signup?errorCodes=BAD_DATA`)
|
||||
return
|
||||
}
|
||||
|
||||
const query = `
|
||||
mutation signup {
|
||||
signup(input: {
|
||||
@ -425,7 +435,7 @@ export function authRouter() {
|
||||
password: "${password}",
|
||||
name: "${name}",
|
||||
username: "${username}",
|
||||
bio: "${bio}"
|
||||
bio: "${bio ?? ''}"
|
||||
}) {
|
||||
__typename
|
||||
... on SignupSuccess {
|
||||
|
||||
@ -52,6 +52,7 @@ export function EmailLogin(): JSX.Element {
|
||||
<BorderedFormInput
|
||||
key="email"
|
||||
type="text"
|
||||
name="email"
|
||||
value={email}
|
||||
placeholder="Email"
|
||||
onChange={(e) => { e.preventDefault(); setEmail(e.target.value); }}
|
||||
@ -63,6 +64,7 @@ export function EmailLogin(): JSX.Element {
|
||||
<BorderedFormInput
|
||||
key="password"
|
||||
type="password"
|
||||
name="password"
|
||||
value={password}
|
||||
placeholder="Password"
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
|
||||
Reference in New Issue
Block a user