@@ -8,6 +8,7 @@ import { deepCodeMessages } from "../../messages/deepCodeMessages";
88import { errorsLogs } from "../../messages/errorsServerLogMessages" ;
99import BaseDeepCodeModule from "./BaseDeepCodeModule" ;
1010import { statusCodes } from "../../constants/statusCodes" ;
11+ import { IDE_NAME } from "../../constants/general" ;
1112
1213class LoginModule extends BaseDeepCodeModule implements DeepCode . LoginModuleInterface {
1314 private analysisOnSaveAllowed : { [ key : string ] : boolean } = { } ;
@@ -42,20 +43,15 @@ class LoginModule extends BaseDeepCodeModule implements DeepCode.LoginModuleInte
4243 ) ;
4344 if ( pressedButton === login . button ) {
4445 try {
45- const result = await http . login ( ) ;
46- const { sessionToken, loginURL } = result ;
46+ const source = process . env [ 'GITPOD_WORKSPACE_ID' ] ? 'gitpod' : IDE_NAME ;
47+ const result = await http . login ( source ) ;
48+ let { sessionToken, loginURL } = result ;
4749 if ( ! sessionToken || ! loginURL ) {
4850 throw new Error ( ) ;
4951 }
5052 this . token = sessionToken ;
5153
52- let options : open . Options | undefined ;
53- if ( process . env [ 'GITPOD_WORKSPACE_ID' ] ) {
54- options = {
55- app : [ 'gp' , 'preview' ]
56- } ;
57- }
58- await open ( loginURL , options ) ;
54+ await open ( loginURL ) ;
5955 return true ;
6056 } catch ( err ) {
6157 this . errorHandler . processError ( this , err , {
@@ -95,7 +91,7 @@ class LoginModule extends BaseDeepCodeModule implements DeepCode.LoginModuleInte
9591 if ( err . statusCode === statusCodes . loginInProgress ) {
9692 return await httpDelay ( pingLoginStatus ) ;
9793 }
98-
94+
9995 extension . errorHandler . processError ( extension , err , {
10096 ...( err . statusCode === statusCodes . notFound && {
10197 loginNotFound : true
0 commit comments