fix: Lowercase email everywhere

This commit is contained in:
Andras Bacsai 2022-02-22 08:12:45 +01:00
parent 76c1480903
commit bc463c37f4
3 changed files with 4 additions and 4 deletions

View File

@ -4,8 +4,8 @@ import { ErrorHandler } from '$lib/database';
import type { RequestHandler } from '@sveltejs/kit'; import type { RequestHandler } from '@sveltejs/kit';
export const post: RequestHandler = async (event) => { export const post: RequestHandler = async (event) => {
let { email, password } = await event.request.json(); const { email, password } = await event.request.json();
email = email.toLowerCase();
try { try {
const { body } = await db.login({ email, password }); const { body } = await db.login({ email, password });
event.locals.session.data = body; event.locals.session.data = body;

View File

@ -18,7 +18,7 @@
async function handleSubmit() { async function handleSubmit() {
loading = true; loading = true;
try { try {
const { teamId } = await post(`/login.json`, { email, password }); const { teamId } = await post(`/login.json`, { email: email.toLowerCase(), password });
if (teamId === '0') { if (teamId === '0') {
window.location.replace('/settings'); window.location.replace('/settings');
} else { } else {

View File

@ -47,7 +47,7 @@
await post(`/teams/${id}/invitation/invite.json`, { await post(`/teams/${id}/invitation/invite.json`, {
teamId: team.id, teamId: team.id,
teamName: invitation.teamName, teamName: invitation.teamName,
email: invitation.email, email: invitation.email.toLowerCase(),
permission: invitation.permission permission: invitation.permission
}); });
return window.location.reload(); return window.location.reload();