-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Personal settings auth tokens #24703
Conversation
aea0805
to
0e32440
Compare
@@ -837,6 +837,13 @@ public function getUserSession() { | |||
} | |||
|
|||
/** | |||
* @return Authentication\Token\DefaultTokenProvider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please either use the full class or import the full class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also only public interfaces shall be returned™
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no public interface yet, because it's not yet done add a FIXME/TODO to make that clear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this is an internal only method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then @internal
? ;)
0e32440
to
8a9aec1
Compare
After applying this: diff --git a/settings/css/settings.css b/settings/css/settings.css
index be61265..42e2594 100644
--- a/settings/css/settings.css
+++ b/settings/css/settings.css
@@ -100,21 +100,27 @@ input#identity {
table.nostyle label { margin-right: 2em; }
table.nostyle td { padding: 0.2em 0; }
-#sessions,
-#devices {
- min-height: 180px;
-}
#sessions table,
#devices table {
width: 100%;
- min-height: 150px;
- padding-top: 25px;
}
#sessions table th,
#devices table th {
font-weight: 800;
}
+#sessions table th,
+#sessions table td,
+#devices table th,
+#devices table td {
+ padding: 10px;
+}
+
+#sessions .token-list td,
+#devices .token-list td {
+ border-top: 1px solid #DDD;
+}
+
/* USERS */
#newgroup-init a span { margin-left: 20px; }
#newgroup-init a span:before {
diff --git a/settings/js/authtoken_view.js b/settings/js/authtoken_view.js
index 0ca1682..b2bdee8 100644
--- a/settings/js/authtoken_view.js
+++ b/settings/js/authtoken_view.js
@@ -50,7 +50,9 @@
list.html('');
tokens.forEach(function(token) {
- var html = _this.template(token.toJSON());
+ var t = token.toJSON();
+ t.lastActivity = moment(t.lastActivity, 'X').format('LLL');
+ var html = _this.template(t);
list.append(html);
});
}, It looks like this: |
@ChristophWurst @PVince81 What is the best way in Backbone to apply the date format stuff? Should this be a template filter? |
So far I'd just preformat the date before passing it to the template as string. |
@@ -36,7 +36,8 @@ | |||
$application->registerRoutes($this, [ | |||
'resources' => [ | |||
'groups' => ['url' => '/settings/users/groups'], | |||
'users' => ['url' => '/settings/users/users'] | |||
'users' => ['url' => '/settings/users/users'], | |||
'AuthSettings' => ['url' => '/settings/personal/authtokens'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we want this information to be available on the client one day, it needs to be OCS, but I think for now it's okay
fef6e35
to
4fae242
Compare
@MorrisJobke @LukasReschke @rullzer review please |
4fae242
to
90c3985
Compare
|
|
I'd even say, as soon as the token field gets displayed, autoselect it. If the user clicks away and clicks on it again, reselect again. Goal is to be able to quickly Ctrl+C. |
|
var SubView = Backbone.View.extend({ | ||
collection: null, | ||
type: 0, | ||
template: Handlebars.compile(TEMPLATE_TOKEN), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compile the template at usage time.
See https://github.com/owncloud/core/blob/v8.2.0/apps/files_versions/js/versionstabview.js#L146
90c3985
to
f90d548
Compare
} | ||
|
||
#device-new-token { | ||
width: 186px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if someone knows a better way let me know
|
|
f90d548
to
124db68
Compare
|
5895033
to
74277c2
Compare
Not a bug in my opinion, but I'll open an enhancement issue. |
Fair enough 👍 |
Second review ? @nickvergessen @schiesbn @MorrisJobke @LukasReschke @Xenopathic @rullzer |
$qb = $this->db->getQueryBuilder(); | ||
$qb->delete('authtoken') | ||
->where($qb->expr()->eq('id', $qb->createNamedParameter($id))) | ||
->andWhere($qb->expr()->eq('uid', $qb->createNamedParameter($user->getUID()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not required, because id is unique?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or don't you check ownership before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, I want to prevent users deleting other users tokens
https://github.com/owncloud/core/pull/24703/files#diff-86dbc8c463c390f9fcc767a856c332a3R147
Works, and I agree that the same name is "not a bug" 👍 |
Cool feature, thanks guys :) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
requires #24686, #24677
fixes #23458
TODO:
Ideas for follow-up PRs:
Mozilla/5.0 (Linux) mirall/2.1.1
to something likeownCloud sync client 2.1.1
cc @MorrisJobke