Skip to content

Commit

Permalink
Fix numerous create calls (#7659)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamakase authored Nov 5, 2021
1 parent 56db806 commit 7fd1804
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
11 changes: 3 additions & 8 deletions airbyte-webapp/src/packages/cloud/services/auth/AuthService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type AuthConfirmPasswordReset = (
export type AuthLogin = (values: {
email: string;
password: string;
}) => Promise<User | null>;
}) => Promise<void>;

export type AuthSignUp = (form: {
email: string;
Expand Down Expand Up @@ -77,7 +77,7 @@ export const AuthenticationProvider: React.FC = ({ children }) => {
const authService = useMemo(() => new GoogleAuthService(() => auth), [auth]);

useEffect(() => {
auth.onAuthStateChanged(async (currentUser) => {
return auth.onAuthStateChanged(async (currentUser) => {
if (state.currentUser === null && currentUser) {
// token = await currentUser.getIdToken();

Expand Down Expand Up @@ -115,13 +115,8 @@ export const AuthenticationProvider: React.FC = ({ children }) => {
inited: state.inited,
isLoading: state.loading,
emailVerified: state.emailVerified,
async login(values: {
email: string;
password: string;
}): Promise<User | null> {
async login(values: { email: string; password: string }): Promise<void> {
await authService.login(values.email, values.password);

return null;
},
async logout(): Promise<void> {
await authService.signOut();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ const LoginPage: React.FC = () => {
password: "",
}}
validationSchema={LoginPageValidationSchema}
onSubmit={async (values, { setFieldError, setStatus }) =>
onSubmit={async (values, { setFieldError }) =>
login(values).catch((err) => {
if (err instanceof FieldError) {
setFieldError(err.field, err.message);
} else {
setStatus(err.message);
setFieldError("password", err.message);
}
})
}
Expand Down

0 comments on commit 7fd1804

Please sign in to comment.