From 44fa57abd36812255df3fdc6b5cded15ffb51c61 Mon Sep 17 00:00:00 2001 From: Gero Posmyk-Leinemann Date: Mon, 1 Aug 2022 14:19:41 +0000 Subject: [PATCH 1/4] [server] Display Auth errors in the UI --- components/server/src/auth/generic-auth-provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/server/src/auth/generic-auth-provider.ts b/components/server/src/auth/generic-auth-provider.ts index 069e6b5eb6d2e1..8645d04748cc25 100644 --- a/components/server/src/auth/generic-auth-provider.ts +++ b/components/server/src/auth/generic-auth-provider.ts @@ -423,7 +423,7 @@ export class GenericAuthProvider implements AuthProvider { let message = "Authorization failed. Please try again."; if (AuthException.is(err)) { - message = `Login was interrupted: ${err.message}`; + return this.sendCompletionRedirectWithError(response, { error: err.message }); } if (this.isOAuthError(err)) { message = "OAuth Error. Please try again."; // this is a 5xx response from authorization service From 7efea0a97f90b165afdd55e6168526424eb5e220 Mon Sep 17 00:00:00 2001 From: Gero Posmyk-Leinemann Date: Mon, 1 Aug 2022 14:26:46 +0000 Subject: [PATCH 2/4] [dashboard] Move to new Alert component --- components/dashboard/src/components/ErrorMessage.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/components/dashboard/src/components/ErrorMessage.tsx b/components/dashboard/src/components/ErrorMessage.tsx index 2d4cac289f37a5..579c74b89786df 100644 --- a/components/dashboard/src/components/ErrorMessage.tsx +++ b/components/dashboard/src/components/ErrorMessage.tsx @@ -6,17 +6,15 @@ import FeedbackComponent from "../feedback-form/FeedbackComponent"; import { isGitpodIo } from "../utils"; +import Alert from "./Alert"; function ErrorMessage(props: { imgSrc: string; imgAlt?: string; message: string }) { return ( <> -
-
- {props.imgAlt -
-
-

{props.message}

-
+
+ + {props.message} +
{isGitpodIo() && ( Date: Mon, 1 Aug 2022 14:01:59 +0000 Subject: [PATCH 3/4] TEST COMMIT --- components/server/ee/src/user/user-service.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/server/ee/src/user/user-service.ts b/components/server/ee/src/user/user-service.ts index 6c12c6cea95127..a88db4c484a010 100644 --- a/components/server/ee/src/user/user-service.ts +++ b/components/server/ee/src/user/user-service.ts @@ -5,7 +5,14 @@ */ import { UserService, CheckSignUpParams, CheckTermsParams } from "../../../src/user/user-service"; -import { User, WorkspaceTimeoutDuration, WORKSPACE_TIMEOUT_EXTENDED, WORKSPACE_TIMEOUT_EXTENDED_ALT, WORKSPACE_TIMEOUT_DEFAULT_LONG, WORKSPACE_TIMEOUT_DEFAULT_SHORT } from "@gitpod/gitpod-protocol"; +import { + User, + WorkspaceTimeoutDuration, + WORKSPACE_TIMEOUT_EXTENDED, + WORKSPACE_TIMEOUT_EXTENDED_ALT, + WORKSPACE_TIMEOUT_DEFAULT_LONG, + WORKSPACE_TIMEOUT_DEFAULT_SHORT, +} from "@gitpod/gitpod-protocol"; import { inject } from "inversify"; import { LicenseEvaluator } from "@gitpod/licensor/lib"; import { Feature } from "@gitpod/licensor/lib/api"; @@ -78,7 +85,8 @@ export class UserServiceEE extends UserService { // 1. check the license const userCount = await this.userDb.getUserCount(true); - if (!this.licenseEvaluator.hasEnoughSeats(userCount)) { + if (userCount > -1) { + //!this.licenseEvaluator.hasEnoughSeats(userCount)) { const msg = `Maximum number of users permitted by the license exceeded`; throw AuthException.create("Cannot sign up", msg, { userCount, params }); } From ca802d2e7e8dae9b44425f3b65104654cb9fc41c Mon Sep 17 00:00:00 2001 From: Gero Posmyk-Leinemann <32448529+geropl@users.noreply.github.com> Date: Tue, 2 Aug 2022 09:02:27 +0200 Subject: [PATCH 4/4] [dashboard] Review comment spacing Co-authored-by: George Tsiolis --- components/dashboard/src/components/ErrorMessage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dashboard/src/components/ErrorMessage.tsx b/components/dashboard/src/components/ErrorMessage.tsx index 579c74b89786df..9d1fd3337eeac8 100644 --- a/components/dashboard/src/components/ErrorMessage.tsx +++ b/components/dashboard/src/components/ErrorMessage.tsx @@ -11,7 +11,7 @@ import Alert from "./Alert"; function ErrorMessage(props: { imgSrc: string; imgAlt?: string; message: string }) { return ( <> -
+
{props.message}