Merge branch 'feature/homepage-auth-detection' into develop
This commit is contained in:
@@ -1,13 +1,14 @@
|
|||||||
import { FC, ReactNode } from 'react';
|
import { FC, ReactNode } from 'react';
|
||||||
import { Main } from '@/app/ui/Main';
|
import { Main } from '@/app/ui/Main';
|
||||||
|
|
||||||
import { authConfig } from "@/app/lib/auth";
|
import { authConfig, myAuth } from "@/app/lib/auth";
|
||||||
import { SignInButton } from '@/app/ui/SignInButton';
|
import { SignInButton } from '@/app/ui/SignInButton';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import { getTranslations } from "next-intl/server";
|
import { getTranslations, getLocale } from "next-intl/server";
|
||||||
import isWebview from "is-ua-webview";
|
import isWebview from "is-ua-webview";
|
||||||
import { headers } from 'next/headers'
|
import { headers } from 'next/headers';
|
||||||
import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
|
import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
|
||||||
|
import Link from 'next/link';
|
||||||
|
|
||||||
type Provider = {
|
type Provider = {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -38,6 +39,8 @@ function getKeyValuesFromObject<T>(obj: any, keys: (keyof T)[]): T {
|
|||||||
|
|
||||||
const Page:FC = async () => {
|
const Page:FC = async () => {
|
||||||
|
|
||||||
|
const session = await myAuth();
|
||||||
|
const locale = await getLocale();
|
||||||
const providers = await getProviders();
|
const providers = await getProviders();
|
||||||
const t = await getTranslations("login-page");
|
const t = await getTranslations("login-page");
|
||||||
// get userAgent from NextJS
|
// get userAgent from NextJS
|
||||||
@@ -76,11 +79,21 @@ const Page:FC = async () => {
|
|||||||
}
|
}
|
||||||
<span className="flex justify-center">
|
<span className="flex justify-center">
|
||||||
{
|
{
|
||||||
|
session ? (
|
||||||
|
<Link
|
||||||
|
href={`/${locale}/home`}
|
||||||
|
className="btn btn-neutral btn-lg"
|
||||||
|
>
|
||||||
|
<Image src="/icon2.png" alt="logo" width={32} height={32} />
|
||||||
|
{t("main-card.go-to-app")}
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
Object.values(providers).map((provider) => (
|
Object.values(providers).map((provider) => (
|
||||||
<div key={provider.name}>
|
<div key={provider.name}>
|
||||||
<SignInButton provider={provider} />
|
<SignInButton provider={provider} />
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
|
)
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
<video className="m-auto mt-4" title={t("main-card.video-title")} role="img" data-js-id="hero" loop muted playsInline autoPlay poster={t("main-card.image-url")}>
|
<video className="m-auto mt-4" title={t("main-card.video-title")} role="img" data-js-id="hero" loop muted playsInline autoPlay poster={t("main-card.image-url")}>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
"title-3": "How much are my expenses?",
|
"title-3": "How much are my expenses?",
|
||||||
"text-1": "These are the questions this simple and free app will help you with ...",
|
"text-1": "These are the questions this simple and free app will help you with ...",
|
||||||
"text-2": "... try it & use it completly free!",
|
"text-2": "... try it & use it completly free!",
|
||||||
|
"go-to-app": "Go to the App",
|
||||||
"in-app-browser-warning": "<strong>WARNING:</strong> we detected you're using an in-app browser.<br></br>This might prevent this app to work properly.<hint>Please use a regular browser to sign in (rezije.app) 😉</hint>",
|
"in-app-browser-warning": "<strong>WARNING:</strong> we detected you're using an in-app browser.<br></br>This might prevent this app to work properly.<hint>Please use a regular browser to sign in (rezije.app) 😉</hint>",
|
||||||
"video-url": "/welcome-demo-vp9-25fps-1500bps.webm",
|
"video-url": "/welcome-demo-vp9-25fps-1500bps.webm",
|
||||||
"image-url": "/hero.png",
|
"image-url": "/hero.png",
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
"title-3": "Koliki su mi troškovi?",
|
"title-3": "Koliki su mi troškovi?",
|
||||||
"text-1": "To su pitanja na koja će ti ova jednostavna aplikacija odgovoriti ...",
|
"text-1": "To su pitanja na koja će ti ova jednostavna aplikacija odgovoriti ...",
|
||||||
"text-2": "... isprobaj je i koristi potpuno besplatno!",
|
"text-2": "... isprobaj je i koristi potpuno besplatno!",
|
||||||
|
"go-to-app": "Uđi u Aplikaciju",
|
||||||
"in-app-browser-warning": "<strong>UPOZORENJE!</strong><br></br>Detektirali smo da je web stranica otvorena u in-app pregledniku. To može dovesti do probleme u radu ove web aplikacije. <hint>Molimo otvori web aplikaciju u normalnom web pregledniku (rezije.app) 😉</hint>",
|
"in-app-browser-warning": "<strong>UPOZORENJE!</strong><br></br>Detektirali smo da je web stranica otvorena u in-app pregledniku. To može dovesti do probleme u radu ove web aplikacije. <hint>Molimo otvori web aplikaciju u normalnom web pregledniku (rezije.app) 😉</hint>",
|
||||||
"video-url": "/welcome-demo-vp9-25fps-1500bps.webm",
|
"video-url": "/welcome-demo-vp9-25fps-1500bps.webm",
|
||||||
"image-url": "/hero.png",
|
"image-url": "/hero.png",
|
||||||
|
|||||||
Reference in New Issue
Block a user