mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 03:49: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 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 = () => {
|
|
||||||
const onSendSecretCode = (code: string) => {
|
const onSendSecretCode = (code: string) => {
|
||||||
console.log(code);
|
console.log(code);
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<AuthLogin
|
<AuthLogin
|
||||||
onSendSecretCode={onSendSecretCode}
|
onSendSecretCode={onSendSecretCode}
|
||||||
discordOAuthLink={`${publicRuntimeConfig.apiPublicURI}/login-bounce`}
|
discordOAuthLink={`${props.apiRoot}/login-bounce`}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default loginPage;
|
export default loginPage;
|
||||||
|
|
||||||
|
loginPage.getInitialProps = (context: NextPageContext) => {
|
||||||
|
const { publicRuntimeConfig } = getConfig();
|
||||||
|
|
||||||
|
return { apiRoot: publicRuntimeConfig.apiPublicURI };
|
||||||
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue