Add LoginMenu.tsx
This commit is contained in:
parent
30a8c56119
commit
c813407c95
@ -1,8 +1,9 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import {FaUser, FaLock} from 'react-icons/fa'
|
||||||
import {ICredentials, IUser} from '@rondo/common'
|
import {ICredentials, IUser} from '@rondo/common'
|
||||||
import {Input} from '../components/Input'
|
import {Input} from '../components/Input'
|
||||||
|
import {Link} from 'react-router-dom'
|
||||||
import {Redirect} from '../components/Redirect'
|
import {Redirect} from '../components/Redirect'
|
||||||
import {FaUser, FaLock} from 'react-icons/fa'
|
|
||||||
|
|
||||||
export interface ILoginFormProps {
|
export interface ILoginFormProps {
|
||||||
error?: string
|
error?: string
|
||||||
@ -47,6 +48,10 @@ export class LoginForm extends React.PureComponent<ILoginFormProps> {
|
|||||||
type='submit'
|
type='submit'
|
||||||
value='Log In'
|
value='Log In'
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Do not have an account? <Link to='/auth/register'>Register</Link>
|
||||||
|
</p>
|
||||||
</form>
|
</form>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,7 +20,11 @@ export class ServerRenderer<State, A extends Action> implements IRenderer {
|
|||||||
const context: StaticRouterContext = {}
|
const context: StaticRouterContext = {}
|
||||||
const stream = renderToNodeStream(
|
const stream = renderToNodeStream(
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<StaticRouter location={url} context={context} >
|
<StaticRouter
|
||||||
|
basename={config.baseUrl}
|
||||||
|
location={url}
|
||||||
|
context={context}
|
||||||
|
>
|
||||||
<RootComponent config={config} />
|
<RootComponent config={config} />
|
||||||
</StaticRouter>
|
</StaticRouter>
|
||||||
</Provider>,
|
</Provider>,
|
||||||
|
|||||||
3
packages/server/@types/express.d.ts
vendored
3
packages/server/@types/express.d.ts
vendored
@ -1,6 +1,9 @@
|
|||||||
declare namespace Application {
|
declare namespace Application {
|
||||||
export interface User {
|
export interface User {
|
||||||
id: number
|
id: number
|
||||||
|
username: string
|
||||||
|
firstName: string
|
||||||
|
lastName: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,12 +8,14 @@ export class RequestLogger implements IMiddleware {
|
|||||||
handle: IHandler = (req, res, next) => {
|
handle: IHandler = (req, res, next) => {
|
||||||
const start = Date.now()
|
const start = Date.now()
|
||||||
res.on('finish', () => {
|
res.on('finish', () => {
|
||||||
const { method, originalUrl } = req
|
const { method, originalUrl, user } = req
|
||||||
|
const username = user ? user.username : ''
|
||||||
const duration = Date.now() - start
|
const duration = Date.now() - start
|
||||||
this.logger.debug('%s %s %j', method, originalUrl, req.body)
|
this.logger.debug('%s %s [%s] %j',
|
||||||
|
method, originalUrl, username, req.body)
|
||||||
const { statusCode } = res
|
const { statusCode } = res
|
||||||
this.logger.info('%s %s %d %sms',
|
this.logger.info('%s %s [%s] %d %sms',
|
||||||
method, originalUrl, statusCode, duration)
|
method, originalUrl, username, statusCode, duration)
|
||||||
})
|
})
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user