Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
deadlock-desktop
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
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
deadlock-public
deadlock-desktop
Commits
9710b408
Commit
9710b408
authored
3 years ago
by
Christian ZHENG
Browse files
Options
Downloads
Patches
Plain Diff
refactor(login): rename method
parent
a8c721ec
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!14
feat: added mounted, .bashrc, .zshrc, added tests, added keycloak tests
,
!8
feat(extension): login, open in devcontainer, automaticly save code, open briefing, publish extension
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
deadlock-plugins/deadlock-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts
+4
-4
4 additions, 4 deletions
...-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts
with
4 additions
and
4 deletions
deadlock-plugins/deadlock-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts
+
4
−
4
View file @
9710b408
import
*
as
https
from
'
https
'
;
import
fetch
,
{
Response
}
from
'
node-fetch
'
;
import
{
error
as
err
,
error
,
log
}
from
'
../recorder/utils
'
;
import
{
HttpStatusCode
}
from
'
../customTypings/HttpStatusCode
'
;
import
{
TokenFetchErrorCode
}
from
'
../customTypings/KeycloakAPITypes
'
;
import
{
error
as
err
,
log
}
from
'
../recorder/utils
'
;
process
.
env
[
'
NODE_TLS_REJECT_UNAUTHORIZED
'
]
=
'
0
'
;
// TODO: remove when SSL will work
...
...
@@ -164,12 +164,12 @@ export default class KeycloakOAuth2DeviceFlowConnection {
}
case
TokenFetchErrorCode
.
authorization_pending
:
{
// I have to keep this `await sleep` and the while in the same function context
await
sleep
(
this
.
_waitDuration
.
getDuration
());
await
sleep
(
this
.
_waitDuration
.
get
Current
Duration
());
continue
;
}
case
TokenFetchErrorCode
.
slow_down
:
{
this
.
_waitDuration
.
increase
();
await
sleep
(
this
.
_waitDuration
.
getDuration
());
await
sleep
(
this
.
_waitDuration
.
get
Current
Duration
());
break
;
}
default
:
{
...
...
@@ -238,7 +238,7 @@ class WaitDuration {
this
.
_durations
.
sort
();
this
.
_index
=
0
;
}
public
getDuration
():
number
{
public
get
Current
Duration
():
number
{
if
(
this
.
_index
>=
this
.
_durations
.
length
-
1
)
{
throw
new
Error
(
`Index out of bounds. Current index:
${
this
.
_index
}
| Max val:
${
this
.
_durations
.
length
-
1
}
`
);
}
...
...
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