mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
another attempt for auth login config
This commit is contained in:
parent
bd15d1f6fa
commit
432922dd21
1 changed files with 5 additions and 3 deletions
|
@ -3,6 +3,8 @@ import getConfig from 'next/config';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { AuthLogin } from 'roleypoly/design-system/templates/auth-login';
|
import { AuthLogin } from 'roleypoly/design-system/templates/auth-login';
|
||||||
|
|
||||||
|
const { publicRuntimeConfig } = getConfig();
|
||||||
|
|
||||||
const loginPage = (props: { apiRoot: string }) => {
|
const loginPage = (props: { apiRoot: string }) => {
|
||||||
const onSendSecretCode = (code: string) => {
|
const onSendSecretCode = (code: string) => {
|
||||||
console.log(code);
|
console.log(code);
|
||||||
|
@ -10,7 +12,9 @@ const loginPage = (props: { apiRoot: string }) => {
|
||||||
return (
|
return (
|
||||||
<AuthLogin
|
<AuthLogin
|
||||||
onSendSecretCode={onSendSecretCode}
|
onSendSecretCode={onSendSecretCode}
|
||||||
discordOAuthLink={`${props.apiRoot}/login-bounce`}
|
discordOAuthLink={`${
|
||||||
|
props.apiRoot || publicRuntimeConfig.apiPublicURI
|
||||||
|
}/login-bounce`}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -18,7 +22,5 @@ const loginPage = (props: { apiRoot: string }) => {
|
||||||
export default loginPage;
|
export default loginPage;
|
||||||
|
|
||||||
loginPage.getInitialProps = (context: NextPageContext) => {
|
loginPage.getInitialProps = (context: NextPageContext) => {
|
||||||
const { publicRuntimeConfig } = getConfig();
|
|
||||||
|
|
||||||
return { apiRoot: publicRuntimeConfig.apiPublicURI };
|
return { apiRoot: publicRuntimeConfig.apiPublicURI };
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue