Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cesium2s
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Cesium-grp
cesium2s
Commits
3d51ea67
Commit
3d51ea67
authored
2 months ago
by
Dorian Marco
Committed by
Benoit Lavenier
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
bugfix/login and registration
parent
7ac46d77
No related branches found
No related tags found
2 merge requests
!29
Add page from Cesium v1, add management of peer
,
!28
bugfix/login and registration
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/account/auth/auth.modal.ts
+32
-30
32 additions, 30 deletions
src/app/account/auth/auth.modal.ts
with
32 additions
and
30 deletions
src/app/account/auth/auth.modal.ts
+
32
−
30
View file @
3d51ea67
...
...
@@ -81,41 +81,43 @@ export class AuthModal implements OnInit, AuthModalOptions {
// Disable the form
this
.
form
.
disable
();
if
(
data
.
v2
.
mnemonic
.
includes
(
'
//
'
))
{
const
account
=
await
this
.
accountService
.
addAccount
(
data
);
return
this
.
modalCtrl
.
dismiss
(
account
,
<
AuthModalRole
>
'
VALIDATE
'
);
}
if
(
this
.
loginMethod
===
'
v2
'
)
{
if
(
data
.
v2
.
mnemonic
.
includes
(
'
//
'
))
{
const
account
=
await
this
.
accountService
.
addAccount
(
data
);
return
this
.
modalCtrl
.
dismiss
(
account
,
<
AuthModalRole
>
'
VALIDATE
'
);
}
// Scan for derivations
const
derivations
=
await
this
.
accountService
.
scanDerivations
(
data
.
v2
.
mnemonic
);
// Scan for derivations
const
derivations
=
await
this
.
accountService
.
scanDerivations
(
data
.
v2
.
mnemonic
);
// Only one derivation: use it
let
selectedDerivationAccount
:
DerivationAccount
;
if
(
derivations
?.
length
===
1
)
{
selectedDerivationAccount
=
derivations
[
0
];
}
// Only one derivation: use it
let
selectedDerivationAccount
:
DerivationAccount
;
if
(
derivations
?.
length
===
1
)
{
selectedDerivationAccount
=
derivations
[
0
];
}
// Many derivation: let the user choose
else
if
(
derivations
?.
length
>
1
)
{
const
modal
=
await
this
.
modalCtrl
.
create
({
component
:
DerivationSelectionComponent
,
componentProps
:
{
mnemonic
:
data
.
v2
.
mnemonic
,
derivations
,
},
});
await
modal
.
present
();
const
res
=
await
modal
.
onDidDismiss
();
if
(
AccountUtils
.
isDerivationAccount
(
res
?.
data
))
{
selectedDerivationAccount
=
res
.
data
;
// Many derivation: let the user choose
else
if
(
derivations
?.
length
>
1
)
{
const
modal
=
await
this
.
modalCtrl
.
create
({
component
:
DerivationSelectionComponent
,
componentProps
:
{
mnemonic
:
data
.
v2
.
mnemonic
,
derivations
,
},
});
await
modal
.
present
();
const
res
=
await
modal
.
onDidDismiss
();
if
(
AccountUtils
.
isDerivationAccount
(
res
?.
data
))
{
selectedDerivationAccount
=
res
.
data
;
}
}
}
// Update mnemonic, to use the derivation
if
(
selectedDerivationAccount
)
{
console
.
info
(
`[auth] Will use derivation:
${
selectedDerivationAccount
?.
derivation
}
`
);
data
.
v2
.
mnemonic
+=
selectedDerivationAccount
?.
derivation
;
// Update mnemonic, to use the derivation
if
(
selectedDerivationAccount
)
{
console
.
info
(
`[auth] Will use derivation:
${
selectedDerivationAccount
?.
derivation
}
`
);
data
.
v2
.
mnemonic
+=
selectedDerivationAccount
?.
derivation
;
}
}
const
account
=
await
this
.
accountService
.
addAccount
(
data
);
...
...
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