mirror of
https://github.com/strapi/strapi.git
synced 2025-12-25 14:14:10 +00:00
Set protected urls from plugin
This commit is contained in:
parent
a60f5ca9f0
commit
b40ee0c5ef
@ -62,15 +62,15 @@ export class AdminPage extends React.Component { // eslint-disable-line react/pr
|
||||
|
||||
hasAdminUser = () => get(this.props.plugins.toJS(), ['users-permissions', 'hasAdminUser']);
|
||||
|
||||
isUrlProtected = (props) => !includes(props.location.pathname, '/plugins/users-permissions/auth');
|
||||
isUrlProtected = (props) => !includes(props.location.pathname, get(this.props.plugins.toJS(), ['users-permissions', 'nonProtectedUrl']));
|
||||
|
||||
showLeftMenu = () => !includes(this.props.location.pathname, '/plugins/users-permissions/auth');
|
||||
showLeftMenu = () => !includes(this.props.location.pathname, get(this.props.plugins.toJS(), ['users-permissions', 'nonProtectedUrl']));
|
||||
|
||||
render() {
|
||||
const leftMenu = this.showLeftMenu() ? <LeftMenu plugins={this.props.plugins} /> : '';
|
||||
const header = this.showLeftMenu() ? <Header /> : '';
|
||||
const style = this.showLeftMenu() ? {} : { width: '100%' };
|
||||
|
||||
|
||||
return (
|
||||
<div className={styles.adminPage}>
|
||||
{leftMenu}
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
const bootstrap = (plugin) => new Promise(resolve => {
|
||||
// TODO add with saga
|
||||
plugin.hasAdminUser = true;
|
||||
|
||||
plugin.nonProtectedUrl = '/plugins/users-permissions/auth';
|
||||
|
||||
return resolve(plugin);
|
||||
});
|
||||
|
||||
|
||||
@ -44,13 +44,16 @@
|
||||
padding-left: 1rem;
|
||||
background-size: 0 !important;
|
||||
border: 1px solid #E3E9F3;
|
||||
border-left: none;
|
||||
// border-left: none;
|
||||
border-radius: 0.25rem;
|
||||
border-bottom-right-radius: 0;
|
||||
line-height: 3.4rem;
|
||||
font-size: 1.3rem;
|
||||
font-family: 'Lato' !important;
|
||||
box-shadow: 0px 1px 1px rgba(104, 118, 142, 0.05);
|
||||
&:focus {
|
||||
border-color: #78caff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -94,6 +94,7 @@ export class EditPage extends React.Component { // eslint-disable-line react/pre
|
||||
<div className="col-md-6">
|
||||
<div className="row">
|
||||
<Input
|
||||
autoFocus
|
||||
customBootstrapClass="col-md-12"
|
||||
label="users-permissions.EditPage.form.roles.label.name"
|
||||
name="name"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user