Skip to content

Commit

Permalink
fix(react): send the token back in the login response
Browse files Browse the repository at this point in the history
  • Loading branch information
jrea committed Oct 25, 2022
1 parent b036d2f commit dc9b467
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/react/src/components/LoginForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export default function LoginForm(props: Props) {
{
onSuccess: (token, data) => {
if (token) {
nile.authToken = token?.token;
onSuccess && onSuccess(data);
onSuccess && onSuccess(token, data);
}
},
onError: (error) => {
Expand Down
7 changes: 6 additions & 1 deletion packages/react/src/components/LoginForm/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { Token } from '@theniledev/js';

import { Attribute } from '../../lib/SimpleForm/types';

type LoginSuccess = (LoginInfo: { email: string; password: string }) => void;
type LoginSuccess = (
token: Token,
LoginInfo: { email: string; password: string }
) => void;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type AllowedAny = any;
Expand Down

2 comments on commit dc9b467

@vercel
Copy link

@vercel vercel bot commented on dc9b467 Oct 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nile-js – ./

nile-js.vercel.app
nile-js-theniledev.vercel.app
nile-js-git-master-theniledev.vercel.app

@vercel
Copy link

@vercel vercel bot commented on dc9b467 Oct 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.