Remove source from rate limit message
This commit is contained in:
parent
072bf2c775
commit
f00c6f2f4d
4 changed files with 8 additions and 8 deletions
|
@ -69,7 +69,7 @@ export async function POST({ locals, request }) {
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
const timeRemaining = Math.floor((reset - Date.now()) / 1000);
|
const timeRemaining = Math.floor((reset - Date.now()) / 1000);
|
||||||
const message = `Võta veits rahulikumalt. API Proovi ${timeRemaining}s pärast uuesti.`;
|
const message = `Võta veits rahulikumalt. Proovi ${timeRemaining}s pärast uuesti.`;
|
||||||
|
|
||||||
return json({ error: message }, { status: 429 });
|
return json({ error: message }, { status: 429 });
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ export const load: PageServerLoad = async (event) => {
|
||||||
|
|
||||||
if (!seshSuccess) {
|
if (!seshSuccess) {
|
||||||
const timeRemaining = Math.floor((seshReset - Date.now()) / 1000);
|
const timeRemaining = Math.floor((seshReset - Date.now()) / 1000);
|
||||||
const message = `Sesh Proovi ${timeRemaining}s pärast uuesti.`;
|
const message = `Proovi ${timeRemaining}s pärast uuesti.`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
stage: stage,
|
stage: stage,
|
||||||
|
@ -62,7 +62,7 @@ export const load: PageServerLoad = async (event) => {
|
||||||
|
|
||||||
if (!ipSuccess) {
|
if (!ipSuccess) {
|
||||||
const timeRemaining = Math.floor((ipReset - Date.now()) / 1000);
|
const timeRemaining = Math.floor((ipReset - Date.now()) / 1000);
|
||||||
const message = `IP Proovi ${timeRemaining}s pärast uuesti.`;
|
const message = `Proovi ${timeRemaining}s pärast uuesti.`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
stage: stage,
|
stage: stage,
|
||||||
|
|
|
@ -61,7 +61,7 @@ export const actions: Actions = {
|
||||||
|
|
||||||
if (!seshSuccess) {
|
if (!seshSuccess) {
|
||||||
const timeRemaining = Math.floor((seshReset - Date.now()) / 1000);
|
const timeRemaining = Math.floor((seshReset - Date.now()) / 1000);
|
||||||
const message = `Võta veits rahulikumalt. Sesh Proovi ${timeRemaining}s pärast uuesti.`;
|
const message = `Võta veits rahulikumalt. Proovi ${timeRemaining}s pärast uuesti.`;
|
||||||
|
|
||||||
if (form.errors.answer) {
|
if (form.errors.answer) {
|
||||||
form.errors.answer.push(message);
|
form.errors.answer.push(message);
|
||||||
|
@ -75,7 +75,7 @@ export const actions: Actions = {
|
||||||
|
|
||||||
if (!ipSuccess) {
|
if (!ipSuccess) {
|
||||||
const timeRemaining = Math.floor((ipReset - Date.now()) / 1000);
|
const timeRemaining = Math.floor((ipReset - Date.now()) / 1000);
|
||||||
const message = `Võta veits rahulikumalt. IP Proovi ${timeRemaining}s pärast uuesti.`;
|
const message = `Võta veits rahulikumalt. Proovi ${timeRemaining}s pärast uuesti.`;
|
||||||
|
|
||||||
if (form.errors.answer) {
|
if (form.errors.answer) {
|
||||||
form.errors.answer.push(message);
|
form.errors.answer.push(message);
|
||||||
|
@ -177,7 +177,7 @@ export const actions: Actions = {
|
||||||
|
|
||||||
if (!seshSuccess) {
|
if (!seshSuccess) {
|
||||||
const timeRemaining = Math.floor((seshReset - Date.now()) / 1000);
|
const timeRemaining = Math.floor((seshReset - Date.now()) / 1000);
|
||||||
const message = `Võta veits rahulikumalt. Sesh Proovi ${timeRemaining}s pärast uuesti.`;
|
const message = `Võta veits rahulikumalt. Proovi ${timeRemaining}s pärast uuesti.`;
|
||||||
|
|
||||||
if (form.errors.question) {
|
if (form.errors.question) {
|
||||||
form.errors.question.push(message);
|
form.errors.question.push(message);
|
||||||
|
@ -191,7 +191,7 @@ export const actions: Actions = {
|
||||||
|
|
||||||
if (!ipSuccess) {
|
if (!ipSuccess) {
|
||||||
const timeRemaining = Math.floor((ipReset - Date.now()) / 1000);
|
const timeRemaining = Math.floor((ipReset - Date.now()) / 1000);
|
||||||
const message = `Võta veits rahulikumalt. IP Proovi ${timeRemaining}s pärast uuesti.`;
|
const message = `Võta veits rahulikumalt. Proovi ${timeRemaining}s pärast uuesti.`;
|
||||||
|
|
||||||
if (form.errors.question) {
|
if (form.errors.question) {
|
||||||
form.errors.question.push(message);
|
form.errors.question.push(message);
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
>Sul on alles {data.user.balance > 0 ? data.user.balance : data.poolSize > 0 ? 0 : 1} küsimust.</Card.Description
|
>Sul on alles {data.user.balance > 0 ? data.user.balance : data.poolSize > 0 ? 0 : 1} küsimust.</Card.Description
|
||||||
>
|
>
|
||||||
</Card.Header>
|
</Card.Header>
|
||||||
{#if data.user.balance === 0 && (!data.question || data.poolSize > 0)}
|
{#if data.user.balance === 0 && (data.question || data.poolSize > 0)}
|
||||||
<Card.Content>
|
<Card.Content>
|
||||||
<p class="text-sm leading-6">Enne küsimist pead kõigepealt vastama teistele!</p>
|
<p class="text-sm leading-6">Enne küsimist pead kõigepealt vastama teistele!</p>
|
||||||
</Card.Content>
|
</Card.Content>
|
||||||
|
|
Loading…
Add table
Reference in a new issue