Skip to content

Commit

Permalink
fix: merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementNumericite committed Sep 25, 2023
1 parent f9e28bc commit 4de3d5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
6 changes: 3 additions & 3 deletions webapp-next/components/login/FormLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ export const FormLogin = () => {
if (code) {
setIsLoading(true);

const res = await triggerVerify({
const res = (await triggerVerify({
username: username,
code: code.toString()
});
})) as any;

if (res.ok) {
const result = await res.json();
Expand All @@ -145,7 +145,7 @@ export const FormLogin = () => {
setFormError(false);
if (username !== '' && password !== '') {
setIsLoading(true);
const res = await triggerLogin({ username, password });
const res = (await triggerLogin({ username, password })) as any;
if (res.ok) {
const result = await res.json();
if (process.env.NODE_ENV === 'development') {
Expand Down
11 changes: 1 addition & 10 deletions webapp-next/pages/api/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,8 @@ import { Client } from '@elastic/elasticsearch';
import fs from 'fs';
import type { NextApiRequest, NextApiResponse } from 'next';
import path from 'path';
const tmpCodes = require('../../../utils/codes');
import AWS from 'aws-sdk';
import rateLimit from '@/utils/rate-limit';

AWS.config.update({
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
region: process.env.AWS_REGION
});

const ses = new AWS.SES({ apiVersion: '2012-10-17' });
const tmpCodes = require('../../../utils/codes');

const limiter = rateLimit({
interval: 60 * 1000, // 60 seconds
Expand Down

0 comments on commit 4de3d5e

Please sign in to comment.