forked from sombochea/verdaccio-ui
feat: login Dialog Component - Replaced class by func. comp + added react-hook-form (#341)
* refactor: convert class to func * refactor: changed login form logic * refactor: conver to testing-library tests * refactor: moved dependency * refactor: replaced uglifyjs-webpack-plugin by terser-webpack-plugin * fix: fixed e2e errors * fix: fixed e2e test * Delete settings.json * fix: vscode settings rollback * refactor: rollback webpack config * refactor: updated eslint rule * fix: removed --fix * refactor: incresed the bundle size
This commit is contained in:
committed by
Juan Picado @jotadeveloper
parent
501845b5f8
commit
42d3bb8508
@@ -47,7 +47,6 @@ export interface LoginBody {
|
||||
}
|
||||
|
||||
export interface LoginError {
|
||||
title: string;
|
||||
type: string;
|
||||
description: string;
|
||||
}
|
||||
@@ -56,7 +55,6 @@ export async function makeLogin(username?: string, password?: string): Promise<L
|
||||
// checks isEmpty
|
||||
if (isEmpty(username) || isEmpty(password)) {
|
||||
const error = {
|
||||
title: 'Unable to login',
|
||||
type: 'error',
|
||||
description: "Username or password can't be empty!",
|
||||
};
|
||||
@@ -77,10 +75,10 @@ export async function makeLogin(username?: string, password?: string): Promise<L
|
||||
};
|
||||
return result;
|
||||
} catch (e) {
|
||||
console.error('login error', e.message);
|
||||
const error = {
|
||||
title: 'Unable to login',
|
||||
type: 'error',
|
||||
description: e.error,
|
||||
description: 'Unable to sign in',
|
||||
};
|
||||
return { error };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user