Merge pull request #1036 from openreplay/fix-login-check
changes from main branch
This commit is contained in:
commit
5aa45d6c2f
7 changed files with 8 additions and 11 deletions
|
|
@ -318,4 +318,6 @@ def get_domain():
|
|||
def obfuscate(text, keep_last: int = 4):
|
||||
if text is None or not isinstance(text, str):
|
||||
return text
|
||||
if len(text) <= keep_last:
|
||||
return "*" * len(text)
|
||||
return "*" * (len(text) - keep_last) + text[-keep_last:]
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from os import environ
|
|||
import requests
|
||||
from decouple import config
|
||||
|
||||
from chalicelib.utils import helper
|
||||
from chalicelib.utils.TimeUTC import TimeUTC
|
||||
|
||||
|
||||
|
|
@ -22,7 +23,7 @@ def check():
|
|||
environ["expiration"] = "-1"
|
||||
environ["numberOfSeats"] = "0"
|
||||
return
|
||||
print(f"validating: {license}")
|
||||
print(f"validating: {helper.obfuscate(license)}")
|
||||
r = requests.post('https://api.openreplay.com/os/license', json={"mid": __get_mid(), "license": get_license()})
|
||||
if r.status_code != 200 or "errors" in r.json() or not r.json()["data"].get("valid"):
|
||||
print("license validation failed")
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ def unlock_cron() -> None:
|
|||
|
||||
|
||||
cron_jobs = [
|
||||
{"func": unlock_cron, "trigger": "cron", "hour": "*"},
|
||||
{"func": unlock_cron, "trigger": CronTrigger(day="*")},
|
||||
]
|
||||
|
||||
SINGLE_CRONS = [{"func": telemetry_cron, "trigger": CronTrigger(day_of_week="*"),
|
||||
|
|
|
|||
|
|
@ -120,8 +120,6 @@ class Router extends React.Component {
|
|||
super(props);
|
||||
if (props.isLoggedIn) {
|
||||
this.fetchInitialData();
|
||||
} else {
|
||||
props.fetchTenants();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import cn from 'classnames';
|
|||
import { setJwt } from 'Duck/user';
|
||||
import LoginBg from '../../svg/login-illustration.svg';
|
||||
import { ENTERPRISE_REQUEIRED } from 'App/constants';
|
||||
import { fetchTenants } from 'Duck/user';
|
||||
|
||||
const FORGOT_PASSWORD = forgotPassword();
|
||||
const SIGNUP_ROUTE = signup();
|
||||
|
|
@ -24,7 +25,7 @@ export default
|
|||
authDetails: state.getIn(['user', 'authDetails']),
|
||||
params: new URLSearchParams(props.location.search),
|
||||
}),
|
||||
{ login, setJwt }
|
||||
{ login, setJwt, fetchTenants }
|
||||
)
|
||||
@withPageTitle('Login - OpenReplay')
|
||||
@withRouter
|
||||
|
|
@ -37,6 +38,7 @@ class Login extends React.Component {
|
|||
|
||||
componentDidMount() {
|
||||
const { params } = this.props;
|
||||
this.props.fetchTenants();
|
||||
const jwt = params.get('jwt');
|
||||
if (jwt) {
|
||||
this.props.setJwt(jwt);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ spec:
|
|||
containers:
|
||||
- name: efs-cleaner
|
||||
image: alpine
|
||||
image: "{{ tpl .Values.efsCleaner.image.repository . }}:{{ .Values.efsCleaner.image.tag | default .Chart.AppVersion }}"
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
|
|
@ -44,7 +43,6 @@ spec:
|
|||
volumeMounts:
|
||||
- mountPath: /mnt/efs
|
||||
name: datadir
|
||||
restartPolicy: Never
|
||||
{{- if eq (tpl .Values.efsCleaner.pvc.name . ) "hostPath" }}
|
||||
volumes:
|
||||
- name: datadir
|
||||
|
|
|
|||
|
|
@ -5,10 +5,6 @@
|
|||
replicaCount: 1
|
||||
|
||||
efsCleaner:
|
||||
image:
|
||||
repository: "{{ .Values.global.openReplayContainerRegistry }}/alpine"
|
||||
pullPolicy: Always
|
||||
tag: 3.16.1
|
||||
retention: 2
|
||||
pvc:
|
||||
# This can be either persistentVolumeClaim or hostPath.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue