Implement authentication and user modules#9
Conversation
…to user/sign-up
evgenijolshanskij
left a comment
There was a problem hiding this comment.
The yarn seed fails.
evgenijolshanskij
left a comment
There was a problem hiding this comment.
I don't want REST Kit to be a dummy "copy/paste" of the existing one. During working on this Kit I would like to take into account all the drawbacks and make it better. I don't think that such a huge amount of components should be placed in one directory. We create a modular structure, thus modules can be split into smaller modules as well.
|
|
||
| import { AuthRoute, IfLoggedIn, IfNotLoggedIn, withLogout, WithLogoutProps } from '../containers/Auth'; | ||
|
|
||
| export interface LoginSubmitProps { |
There was a problem hiding this comment.
I suggest using types dir for not polluting index files.
| <AuthRoute exact path="/reset-password/:token" redirectOnLoggedIn redirect="/profile" component={ResetPassword} /> | ||
| ], | ||
| navItemRight: [ | ||
| <IfLoggedIn key="/logout"> |
There was a problem hiding this comment.
All components should have been moved out of the index file.
| } | ||
|
|
||
| const UserAddView = ({ t, onSubmit }: UserAddViewProps) => { | ||
| const renderMetaData = () => ( |
There was a problem hiding this comment.
What is the point to duplicate this code snippet in ALL components?
| @@ -0,0 +1,7 @@ | |||
| import { ActionFunction, ActionType } from '.'; | |||
|
|
|||
| const CLEAR_USER: ActionFunction<ActionType> = () => ({ | |||
There was a problem hiding this comment.
I have never seen functions to be called like this. Could you please give me a link to this convention.
| meta: string; | ||
| } | ||
|
|
||
| const MetaData = ({ title, meta }: MetaDataProps) => ( |
There was a problem hiding this comment.
Why MetaData is located in the user? Is it the only module that will use it?
| rerenderApp(); | ||
| }; | ||
|
|
||
| class PageReloader extends React.Component<PageReloaderProps> { |
There was a problem hiding this comment.
We should stop using class-based components in favor of functional ones.
This reverts commit 83f442b
This pull request will add authorization and user modules. Both frontend and backend are implemented using TypeScript. All authorization flows (JWT, session, socials) implemented using passport.