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