mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
Webatrice: fix login bugs (#4557)
* fix login after failed connection attempts, limit connection attempt time * fix register hashed password and salt * add feature detection and Unsupported Browser screen * nit Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
81d031ca0f
commit
bb16ae09ef
17 changed files with 104 additions and 18 deletions
26
webclient/src/containers/App/FeatureDetection.tsx
Normal file
26
webclient/src/containers/App/FeatureDetection.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { useEffect, useState } from 'react';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import { dexieService } from 'services';
|
||||
import { RouteEnum } from 'types';
|
||||
|
||||
const FeatureDetection = () => {
|
||||
const [unsupported, setUnsupported] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const features: Promise<any>[] = [
|
||||
detectIndexedDB(),
|
||||
];
|
||||
|
||||
Promise.all(features).catch((e) => setUnsupported(true));
|
||||
}, []);
|
||||
|
||||
return unsupported
|
||||
? <Redirect from="*" to={RouteEnum.UNSUPPORTED} />
|
||||
: <></>;
|
||||
|
||||
function detectIndexedDB() {
|
||||
return dexieService.testConnection();
|
||||
}
|
||||
};
|
||||
|
||||
export default FeatureDetection;
|
||||
Loading…
Add table
Add a link
Reference in a new issue