Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Cesium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Cesium-grp
Cesium
Commits
71fbd200
There was a problem fetching the pipeline summary.
Commit
71fbd200
authored
7 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
[fix] Login using file + drag&drop failed - Fix
#696
parent
b39973e4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
www/js/controllers/login-controllers.js
+3
-2
3 additions, 2 deletions
www/js/controllers/login-controllers.js
www/js/services/crypto-services.js
+6
-2
6 additions, 2 deletions
www/js/services/crypto-services.js
with
9 additions
and
4 deletions
www/js/controllers/login-controllers.js
+
3
−
2
View file @
71fbd200
...
@@ -337,9 +337,10 @@ function LoginModalController($scope, $timeout, $q, $ionicPopover, CryptoUtils,
...
@@ -337,9 +337,10 @@ function LoginModalController($scope, $timeout, $q, $ionicPopover, CryptoUtils,
$scope
.
formData
.
file
=
{
$scope
.
formData
.
file
=
{
name
:
file
.
fileData
.
name
,
name
:
file
.
fileData
.
name
,
size
:
file
.
fileData
.
size
size
:
file
.
fileData
.
size
,
content
:
file
.
fileContent
};
};
return
CryptoUtils
.
parse
KeyFile
Content
(
file
.
fileContent
,
false
/*withSecret*/
)
return
CryptoUtils
.
read
KeyFile
(
$scope
.
formData
.
file
,
false
/*withSecret*/
)
.
then
(
function
(
keypair
)
{
.
then
(
function
(
keypair
)
{
if
(
!
keypair
||
!
keypair
.
signPk
)
{
if
(
!
keypair
||
!
keypair
.
signPk
)
{
$scope
.
formData
.
file
.
valid
=
false
;
$scope
.
formData
.
file
.
valid
=
false
;
...
...
This diff is collapsed.
Click to expand it.
www/js/services/crypto-services.js
+
6
−
2
View file @
71fbd200
...
@@ -141,6 +141,11 @@ angular.module('cesium.crypto.services', ['cesium.utils.services'])
...
@@ -141,6 +141,11 @@ angular.module('cesium.crypto.services', ['cesium.utils.services'])
CryptoAbstractService
.
prototype
.
readKeyFile
=
function
(
file
,
withSecret
)
{
CryptoAbstractService
.
prototype
.
readKeyFile
=
function
(
file
,
withSecret
)
{
var
that
=
this
;
var
that
=
this
;
if
(
file
&&
file
.
content
)
{
return
that
.
parseKeyFileContent
(
file
.
content
,
withSecret
);
}
return
$q
(
function
(
resolve
,
reject
)
{
return
$q
(
function
(
resolve
,
reject
)
{
if
(
!
file
)
{
if
(
!
file
)
{
return
reject
(
'
Argument [file] is missing
'
);
return
reject
(
'
Argument [file] is missing
'
);
...
@@ -149,8 +154,7 @@ angular.module('cesium.crypto.services', ['cesium.utils.services'])
...
@@ -149,8 +154,7 @@ angular.module('cesium.crypto.services', ['cesium.utils.services'])
console
.
debug
(
'
[crypto] [keypair] reading file:
'
,
file
);
console
.
debug
(
'
[crypto] [keypair] reading file:
'
,
file
);
var
reader
=
new
FileReader
();
var
reader
=
new
FileReader
();
reader
.
onload
=
function
(
event
)
{
reader
.
onload
=
function
(
event
)
{
var
res
=
that
.
parseKeyFileContent
(
event
.
target
.
result
,
withSecret
);
that
.
parseKeyFileContent
(
event
.
target
.
result
,
withSecret
)
res
.
then
(
function
(
res
)
{
.
then
(
function
(
res
)
{
resolve
(
res
);
resolve
(
res
);
})
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment