mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Move environment variables to middleware. Closes #972.
This commit is contained in:
parent
736347d37c
commit
7270d95240
6 changed files with 47 additions and 30 deletions
|
|
@ -1,14 +0,0 @@
|
|||
import { useEffect } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
|
||||
export default function useForceSSL(enabled) {
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
if (enabled && typeof window !== 'undefined' && /^http:\/\//.test(location.href)) {
|
||||
router.push(location.href.replace(/^http:\/\//, 'https://'));
|
||||
}
|
||||
}, [enabled]);
|
||||
|
||||
return null;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue