parent
e7d66e7c04
commit
359485170d
@ -191,7 +191,8 @@ export default class MagicLinkController<A extends Application> extends Controll
|
|||||||
|
|
||||||
if (!res.headersSent && user) {
|
if (!res.headersSent && user) {
|
||||||
// Auth success
|
// Auth success
|
||||||
req.flash('success', `Authentication success. Welcome, ${user.name}!`);
|
const name = user.asOptional(UserNameComponent)?.name;
|
||||||
|
req.flash('success', `Authentication success. Welcome${name ? `, ${name}` : ''}`);
|
||||||
res.redirect(req.getIntendedUrl() || Controller.route('home'));
|
res.redirect(req.getIntendedUrl() || Controller.route('home'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -9,6 +9,8 @@ import UserEmail from "../auth/models/UserEmail";
|
|||||||
import UserApprovedComponent from "../auth/models/UserApprovedComponent";
|
import UserApprovedComponent from "../auth/models/UserApprovedComponent";
|
||||||
import {RequireAdminMiddleware, RequireAuthMiddleware} from "../auth/AuthComponent";
|
import {RequireAdminMiddleware, RequireAuthMiddleware} from "../auth/AuthComponent";
|
||||||
import NunjucksComponent from "../components/NunjucksComponent";
|
import NunjucksComponent from "../components/NunjucksComponent";
|
||||||
|
import ModelFactory from "../db/ModelFactory";
|
||||||
|
import UserNameComponent from "../auth/models/UserNameComponent";
|
||||||
|
|
||||||
export default class BackendController extends Controller {
|
export default class BackendController extends Controller {
|
||||||
private static readonly menu: BackendMenuElement[] = [];
|
private static readonly menu: BackendMenuElement[] = [];
|
||||||
@ -65,6 +67,7 @@ export default class BackendController extends Controller {
|
|||||||
.get();
|
.get();
|
||||||
res.render('backend/accounts_approval', {
|
res.render('backend/accounts_approval', {
|
||||||
accounts: accounts,
|
accounts: accounts,
|
||||||
|
has_user_name_component: ModelFactory.get(User).hasComponent(UserNameComponent),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ route('account') }}"><i data-feather="user"></i>
|
<a href="{{ route('account') }}"><i data-feather="user"></i>
|
||||||
<span class="tip">{{ user.name }}</span></a>
|
<span class="tip">{{ user.name | default('Account') }}</span></a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
|
@ -10,7 +10,9 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="shrink-col">#</th>
|
<th class="shrink-col">#</th>
|
||||||
|
{% if has_user_name_component %}
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
|
{% endif %}
|
||||||
<th>Main email</th>
|
<th>Main email</th>
|
||||||
<th>Registered at</th>
|
<th>Registered at</th>
|
||||||
<th class="shrink-col">Action</th>
|
<th class="shrink-col">Action</th>
|
||||||
@ -20,7 +22,9 @@
|
|||||||
{% for user in accounts %}
|
{% for user in accounts %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ user.id }}</td>
|
<td>{{ user.id }}</td>
|
||||||
|
{% if has_user_name_component %}
|
||||||
<td>{{ user.name }}</td>
|
<td>{{ user.name }}</td>
|
||||||
|
{% endif %}
|
||||||
<td>{{ user.mainEmail.getOrFail().email | default('No email') }}</td>
|
<td>{{ user.mainEmail.getOrFail().email | default('No email') }}</td>
|
||||||
<td>{{ user.created_at.toISOString() }}</td>
|
<td>{{ user.created_at.toISOString() }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
Loading…
Reference in New Issue
Block a user