LDAP auth seems to work too.
Users completely refactored to ReactJS and Knex Initial draft of call context passing (for the time being only in users:remove
This commit is contained in:
parent
9758b4b104
commit
be7da791db
11 changed files with 24 additions and 816 deletions
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
import React, { Component } from 'react';
|
||||
import { translate } from 'react-i18next';
|
||||
import { translate, Trans } from 'react-i18next';
|
||||
import { withPageHelpers, Title } from '../lib/page'
|
||||
import {
|
||||
withForm, Form, Fieldset, FormSendMethod, InputField, ButtonRow, Button
|
||||
|
@ -185,11 +185,15 @@ export default class Account extends Component {
|
|||
</div>
|
||||
);
|
||||
} else {
|
||||
<div>
|
||||
<Title>{t('Account')}</Title>
|
||||
return (
|
||||
<div>
|
||||
<Title>{t('Account')}</Title>
|
||||
|
||||
<p>Account management is not possible because Mailtrain is configured to use externally managed users.</p>
|
||||
</div>
|
||||
<p>{t('Account management is not possible because Mailtrain is configured to use externally managed users.')}</p>
|
||||
|
||||
{mailtrainConfig.externalPasswordResetLink && <p><Trans>If you want to change the password, use <a href={mailtrainConfig.externalPasswordResetLink}>this link</a>.</Trans></p>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,6 +89,13 @@ export default class Login extends Component {
|
|||
render() {
|
||||
const t = this.props.t;
|
||||
|
||||
let passwordResetLink;
|
||||
if (mailtrainConfig.isAuthMethodLocal) {
|
||||
passwordResetLink = <Link to={`/account/forgot/${this.getFormValue('username')}`}>{t('Forgot your password?')}</Link>;
|
||||
} else if (mailtrainConfig.externalPasswordResetLink) {
|
||||
passwordResetLink = <a href={mailtrainConfig.externalPasswordResetLink}>{t('Forgot your password?')}</a>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Title>{t('Sign in')}</Title>
|
||||
|
@ -100,7 +107,7 @@ export default class Login extends Component {
|
|||
|
||||
<ButtonRow>
|
||||
<Button type="submit" className="btn-primary" icon="ok" label={t('Sign in')}/>
|
||||
{mailtrainConfig.isAuthMethodLocal && <Link to={`/account/forgot/${this.getFormValue('username')}`}>{t('Forgot your password?')}</Link>}
|
||||
{passwordResetLink}
|
||||
</ButtonRow>
|
||||
</Form>
|
||||
</div>
|
||||
|
|
|
@ -16,12 +16,12 @@ import mailtrainConfig from 'mailtrainConfig';
|
|||
|
||||
const getStructure = t => {
|
||||
const subPaths = {
|
||||
'login': {
|
||||
login: {
|
||||
title: t('Sign in'),
|
||||
link: '/account/login',
|
||||
component: Login,
|
||||
},
|
||||
'api': {
|
||||
api: {
|
||||
title: t('API'),
|
||||
link: '/account/api',
|
||||
component: API
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue