<commit_before>import React from 'react';
import { Route, Redirect } from 'react-router-dom';
import * as firebase from 'firebase';

class SecuredRoute extends React.Component {
    render() {
        const { component: Component, ...rest } = this.props;
        const auth = firebase.auth().currentUser;

        return (
            auth
            ?<Redirect to="/signin" />
            :<Route {...rest} render={ props => <Component {...props} /> } />
        )
    }
}

export { SecuredRoute };<commit_msg>Update SecuredRoute component to avoid firebase lazy user fetching<commit_after>import React from 'react';
import { Route, Redirect } from 'react-router-dom';
import { isAuthenticated } from '../../helper/auth';

export const SecuredRoute = ({ component: Component, ...rest }) => (
    isAuthenticated()
    ?<Route {...rest} render={ props => <Component {...props} /> } />
    :<Redirect to="/signin" />
);
{'fraction_non_alphanumeric': 0.16213275299238303, 'fraction_numerical': 0.0, 'mean_word_length': 2.8016528925619837, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5095876', 'n_tokens_mistral': 260, 'n_tokens_neox': 259, 'n_words': 75}