mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 11:29:12 +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 { AuthLogin } from 'roleypoly/design-system/templates/auth-login';
|
||||
|
||||
const { publicRuntimeConfig } = getConfig();
|
||||
|
||||
const loginPage = (props: { apiRoot: string }) => {
|
||||
const onSendSecretCode = (code: string) => {
|
||||
console.log(code);
|
||||
|
@ -10,7 +12,9 @@ const loginPage = (props: { apiRoot: string }) => {
|
|||
return (
|
||||
<AuthLogin
|
||||
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;
|
||||
|
||||
loginPage.getInitialProps = (context: NextPageContext) => {
|
||||
const { publicRuntimeConfig } = getConfig();
|
||||
|
||||
return { apiRoot: publicRuntimeConfig.apiPublicURI };
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue