Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
RocketChat
Rocket.Chat.Apps-cli
Commits
623da2d6
Unverified
Commit
623da2d6
authored
Oct 01, 2019
by
Bradley Hilton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display the url for people to copy
parent
0a68c3fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
src/misc/cloudAuth.ts
src/misc/cloudAuth.ts
+5
-0
No files found.
src/misc/cloudAuth.ts
View file @
623da2d6
import
{
Request
,
Server
}
from
'
@hapi/hapi
'
;
import
axios
from
'
axios
'
;
import
chalk
from
'
chalk
'
;
import
{
cli
}
from
'
cli-ux
'
;
import
Conf
=
require
(
'
conf
'
);
import
{
createHash
}
from
'
crypto
'
;
import
open
=
require
(
'
open
'
);
...
...
@@ -62,6 +64,9 @@ export class CloudAuth {
const
codeChallenge
=
createHash
(
'
sha256
'
).
update
(
this
.
codeVerifier
).
digest
(
'
base64
'
);
const
authorizeUrl
=
this
.
buildAuthorizeUrl
(
codeChallenge
);
cli
.
log
(
chalk
.
green
(
'
*
'
)
+
'
'
+
chalk
.
white
(
'
...if your browser does not open, open this:
'
)
+
'
'
+
chalk
.
underline
(
chalk
.
blue
(
authorizeUrl
)));
open
(
authorizeUrl
);
this
.
server
.
start
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment