This repository has been archived by the owner on Apr 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from nodes-vapor/develop
Should reset pw is now working
- Loading branch information
Showing
11 changed files
with
179 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 33 additions & 33 deletions
66
Sources/AdminPanel/Resources/Views/Layout/Partials/Top-bar/user-menu.leaf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
|
||
<div class="dropdown dropdown-user"> | ||
<button class="btn btn-transparent dropdown-toggle user__info-button" data-toggle="dropdown"> | ||
<img class="user__info-avatar img-responsive img-circle" src="#(request.storage.authedBackendUser.imageUrl)"/> | ||
<span class="user__info-name"> | ||
#(request.storage.authedBackendUser.email) | ||
<span class="caret"></span> | ||
</span> | ||
</button> | ||
<div class="dropdown-menu dropdown-inverse animate-expand align-right"> | ||
<div class="dropdown-content"> | ||
<p class="dropdown-content__title">User</p> | ||
|
||
<div class="user"> | ||
<div class="user__profile"> | ||
<img class="user__info-avatar img-responsive img-circle" src="#(request.storage.authedBackendUser.imageUrl)"> | ||
</div> | ||
<div class="user__info"> | ||
<span class="user__info-name"> | ||
#(request.storage.authedBackendUser.name) | ||
</span> | ||
<span class="user__info-email"> | ||
#(request.storage.authedBackendUser.email) | ||
</span> | ||
</div> | ||
</div> | ||
<div class="user-actions"> | ||
<a href="/admin/backend_users/logout" class="btn btn-sm btn-transparent user__sign-out"> | ||
<i class="fa fa-sign-out"></i> | ||
Sign out | ||
</a> | ||
<a href="/admin/users/edit/1" class="btn btn-sm btn-transparent user__settings" data-toggle="tooltip" data-placement="left" title="" data-original-title="Edit user"> | ||
<i class="fa fa-pencil"></i> | ||
</a> | ||
<div class="dropdown dropdown-user"> | ||
<button class="btn btn-transparent dropdown-toggle user__info-button" data-toggle="dropdown"> | ||
<img class="user__info-avatar img-responsive img-circle" src="#(request.storage.authedBackendUser.imageUrl)"/> | ||
<span class="user__info-name"> | ||
#(request.storage.authedBackendUser.email) | ||
<span class="caret"></span> | ||
</span> | ||
</button> | ||
<div class="dropdown-menu dropdown-inverse animate-expand align-right"> | ||
<div class="dropdown-content"> | ||
<p class="dropdown-content__title">User</p> | ||
|
||
<div class="user"> | ||
<div class="user__profile"> | ||
<img class="user__info-avatar img-responsive img-circle" src="#(request.storage.authedBackendUser.imageUrl)"> | ||
</div> | ||
<div class="user__info"> | ||
<span class="user__info-name"> | ||
#(request.storage.authedBackendUser.name) | ||
</span> | ||
<span class="user__info-email"> | ||
#(request.storage.authedBackendUser.email) | ||
</span> | ||
</div> | ||
</div> | ||
<div class="user-actions"> | ||
<a href="/admin/backend_users/logout" class="btn btn-sm btn-transparent user__sign-out"> | ||
<i class="fa fa-sign-out"></i> | ||
Sign out | ||
</a> | ||
<a href="/admin/backend_users/edit/#(request.storage.authedBackendUser.id)" class="btn btn-sm btn-transparent user__settings" data-toggle="tooltip" data-placement="left" title="" data-original-title="Edit user"> | ||
<i class="fa fa-pencil"></i> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
Sources/AdminPanel/Support/Extensions/Request+AuthedBackendUser.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import VaporForms | ||
import HTTP | ||
import Vapor | ||
|
||
extension Request { | ||
public func authedBackendUser() throws -> BackendUser { | ||
|
||
guard let backendUser: BackendUser = try auth.user() as? BackendUser else { | ||
throw Abort.custom(status: .internalServerError, message: "The authed user is not a BackendUser") | ||
} | ||
|
||
return backendUser | ||
} | ||
} |
Oops, something went wrong.