Skip to content
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

display error if token with same application name exists #27587

Closed
wants to merge 7 commits into from

Conversation

phisch
Copy link
Contributor

@phisch phisch commented Apr 6, 2017

Description

Since #27415 seems to be inactive, i created migrations for the authtoken table creation and unique constraint, catched the exception and rendered an appropriate error message.

Related Issue

#24778
#27415 (PR)

Motivation and Context

See related issues & pull requests.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

OC.Notification.showTemporary(t('core', 'Error while creating device token'));
$.when(creatingToken).fail(function(xhr) {
if (xhr.status === 409) {
OC.Notification.showTemporary(t('core', 'A token for that application already exists. Please choose another application name.'));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DeepDiver1975 can you get me the translations for that string?
Not sure if i will get translations by putting them into transifex myself (not under the owncloud organisation).

@phisch phisch mentioned this pull request Apr 6, 2017
9 tasks
@phisch
Copy link
Contributor Author

phisch commented Apr 7, 2017

The added index is a problem because name is a text without a fixed length which then can't be used in a index. I imagine this is a text because it contains the useragent. Maybe we could set a fixed length (like 500) and cut Useragent strings that are too long?

@phisch
Copy link
Contributor Author

phisch commented Apr 7, 2017

Hm, that would also be a bad solution since it could run into unique constraint violations with old tokens...
It's quite bad that we use the same column for user defined names and user-agent strings.
Will think of a proper solution once i have more time for it.

@PVince81 PVince81 added this to the 10.0.1 milestone Apr 7, 2017
@DeepDiver1975 DeepDiver1975 modified the milestones: 10.0.1, 10.1 May 17, 2017
@PVince81
Copy link
Contributor

PVince81 commented Jul 4, 2017

@phisch close ?

I see one of the files is new migrations that you have added for the tokens table. However I think you already added migrations for that when working on the 9.0->10.0 upgrade. I suggest closing for now as this is not a critical issue and I don't think it's worth spending too much time on a low severity issue.

@DeepDiver1975 DeepDiver1975 deleted the fix-same-token-name branch January 11, 2018 10:42
@lock
Copy link

lock bot commented Aug 1, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants