0
0
mirror of https://github.com/yude-jp/yude.jp synced 2025-10-13 11:48:37 +09:00

Using next.config.js rewrite for UUID validation

This commit is contained in:
2021-09-24 10:08:30 +09:00
parent b95c6b4cd5
commit ee913461f1
3 changed files with 17 additions and 18 deletions

View File

@@ -1,15 +0,0 @@
import Players from './Players'
import WrongUUID from './WrongUUID'
function App (props) {
const uuid = props;
const regex = "[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}";
if (uuid.uuid.match(regex)) {
return <Players uuid={uuid.uuid} />
} else {
return <WrongUUID />
}
}
export default App;