import * as React from "react" ; import { compose , lifecycle , pure , setDisplayName } from "recompose" ; import { AuthenticateRequest , Session } from "common" ; import { withCallback , WithCallback , WithFormSubmit , WithRememberMe , withSession , WithSession } from "enhancers" ; /**
 * Authentication success properties
 */ export type AuthenticateSuccessProps = WithRememberMe & WithFormSubmit < AuthenticateRequest , Session < string > > ; /**
 * Lifecycle properties
 */ type LifecycleProps = AuthenticateSuccessProps & WithSession & WithCallback ; return export const Render = ( ) => < div > < /div>; return export function enhance ( ) { return compose < { } , AuthenticateSuccessProps > ( withSession ( ) , withCallback ( ) , lifecycle < LifecycleProps , { } > ( { componentDidMount ( ) { const { form , initSession } = this . props ; if ( form . response ) initSession ( form . response ) ; } , componentDidUpdate ( ) { const { session , callback } = this . props ; if ( session && session . renewed ) callback ( session . id ) ; } } ) , pure , setDisplayName ( "AuthenticateSuccess" ) ) ; } /**
 * Authentication success component
 */ export const AuthenticateSuccess = enhance ( ) ( Render ) ;