Skip to content

Commit

Permalink
Change type
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindgamesnl committed May 5, 2024
1 parent e51cf3c commit f2267de
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/public/metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"buildMajor":1,"buildMinor":125,"buildRevision":239,"buildTag":"dev","buildDate":"Sun Mar 31 2024","build":"1.125.239 dev"}
{"buildMajor":1,"buildMinor":125,"buildRevision":240,"buildTag":"dev","buildDate":"Sun May 05 2024","build":"1.125.240 dev"}
4 changes: 2 additions & 2 deletions client/src/client/login/ClientTokenSet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { API_ENDPOINT } from '../config/ApiEndpoints';
import { ReportError } from '../util/ErrorReporter';
import { setGlobalState } from '../../state/store';
import { VERSION } from '../../build';
import { showTextModal } from '../../components/modal/InputModal';

export default class ClientTokenSet {
constructor(publicServerKey, playerUUID, playerName, playerToken, scope) {
Expand Down Expand Up @@ -91,8 +90,9 @@ export default class ClientTokenSet {
if (body.status === 409) {
setGlobalState({
isLoading: false,
isBlocked: true,
isValidationError: true,
});
showTextModal('Invalid client', 'This client is not whitelisted to be used on this server. Please set this client as your base url in your account', 'and try again.');
ReportError('Invalid token', window.tokenCache.name);
resolve(null);
return;
Expand Down
2 changes: 1 addition & 1 deletion client/src/metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"buildMajor":1,"buildMinor":125,"buildRevision":239,"buildTag":"dev","buildDate":"Sun Mar 31 2024","build":"1.125.239 dev"}
{"buildMajor":1,"buildMinor":125,"buildRevision":240,"buildTag":"dev","buildDate":"Sun May 05 2024","build":"1.125.240 dev"}
1 change: 1 addition & 0 deletions client/src/state/store.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const initialState = {
isLoading: true,
isBlocked: false, // whenever an account is temporarily blocked (rate-limiting, abuse)
isPersonalBlock: false, // whenever this user is personally rate-limited or blocked (due to for example, dmca abuse)
isValidationError: false, // whenever the client is not whitelisted to be used on this server
loadingState: 'Preparing to load OpenAudioMc',
fixedFooter: null,
navbarDetails: true,
Expand Down
15 changes: 13 additions & 2 deletions client/src/views/login/BlockedLoginView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function BlockedLoginView(props) {
<div className="card flex-shrink-0 w-full max-w-sm shadow-2xl bg-base-100">
<div className="card-body">
<div>
{props.isPersonalBlock ? (
{!props.isValidationError && props.isPersonalBlock ? (
<p className="w-80 text-center text-sm mb-8 text-white tracking-wide cursor-pointer">
You are currently blocked from using OpenAudioMc. Please contact support at
{' '}
Expand All @@ -20,7 +20,7 @@ function BlockedLoginView(props) {
</p>
) : null}

{!props.isPersonalBlock && (
{!props.isValidationError && !props.isPersonalBlock && (
<p className="w-80 text-center text-sm mb-8 text-white tracking-wide cursor-pointer">
This server/account is (temporarily) blocked from using OpenAudioMc.
If you&apos;re the owner of this server, please contact support at
Expand All @@ -30,6 +30,14 @@ function BlockedLoginView(props) {
to appeal.
</p>
)}

{props.isValidationError ? (
<p className="w-80 text-center text-sm mb-8 text-white tracking-wide cursor-pointer">
This client is not whitelisted to be used on this server. Please set this client as your base url in
your account and try again.
to appeal.
</p>
) : null}
</div>
</div>
</div>
Expand All @@ -40,11 +48,14 @@ function BlockedLoginView(props) {

BlockedLoginView.propTypes = {
isPersonalBlock: PropTypes.bool.isRequired,
isValidationError: PropTypes.bool.isRequired,
};

export default connect(mapStateToProps)(BlockedLoginView);

function mapStateToProps(state) {
return {
isPersonalBlock: state.isPersonalBlock,
isValidationError: state.isValidationError,
};
}

0 comments on commit f2267de

Please sign in to comment.