mirror of
https://github.com/Nezumi-2711/onedrive-vercel-index.git
synced 2026-09-22 13:38:45 +00:00
pass locale related info into oauth guide page props
This commit is contained in:
@@ -2,6 +2,7 @@ import Head from 'next/head'
|
||||
import Image from 'next/image'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useTranslation, Trans } from 'next-i18next'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
|
||||
import siteConfig from '../../config/site.config'
|
||||
import apiConfig from '../../config/api.config'
|
||||
@@ -145,3 +146,11 @@ export default function OAuthStep1() {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export async function getServerSideProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ['common']))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useRouter } from 'next/router'
|
||||
import { useState } from 'react'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
import { useTranslation, Trans } from 'next-i18next'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
|
||||
import siteConfig from '../../config/site.config'
|
||||
import Navbar from '../../components/Navbar'
|
||||
@@ -138,3 +139,11 @@ export default function OAuthStep2() {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export async function getServerSideProps({ locale }) {
|
||||
return {
|
||||
props: {
|
||||
...(await serverSideTranslations(locale, ['common']))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useRouter } from 'next/router'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
import { useTranslation, Trans } from 'next-i18next'
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
||||
|
||||
import siteConfig from '../../config/site.config'
|
||||
import Navbar from '../../components/Navbar'
|
||||
@@ -221,7 +222,7 @@ export default function OAuthStep3({ accessToken, expiryTime, refreshToken, erro
|
||||
)
|
||||
}
|
||||
|
||||
export async function getServerSideProps({ query }) {
|
||||
export async function getServerSideProps({ query, locale }) {
|
||||
const { authCode } = query
|
||||
|
||||
// Return if no auth code is present
|
||||
@@ -255,6 +256,7 @@ export async function getServerSideProps({ query }) {
|
||||
expiryTime,
|
||||
accessToken,
|
||||
refreshToken,
|
||||
...(await serverSideTranslations(locale, ['common']))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user