From 7e860847e3e339debf793c53624c1ad34d56c4dd Mon Sep 17 00:00:00 2001 From: dragoni7 Date: Mon, 24 Jun 2024 23:05:40 -0700 Subject: [PATCH 1/2] Fixed refresh token error. Added styling to landing page --- src/app/routes/Landing.tsx | 32 +++++++++++++++++++++--------- src/features/auth/BungieLogin.tsx | 2 +- src/index.css | 8 -------- src/lib/bungie_api/TokenService.ts | 2 +- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/app/routes/Landing.tsx b/src/app/routes/Landing.tsx index 5967102..f82e697 100644 --- a/src/app/routes/Landing.tsx +++ b/src/app/routes/Landing.tsx @@ -1,10 +1,11 @@ import { useNavigate } from 'react-router' -import { useEffect} from "react" +import React, { useEffect} from "react" import BungieLogin from '../../features/auth/BungieLogin' import { regenerateTokens } from '../../lib/bungie_api/TokenService' import { isAuthenticated } from '../../lib/bungie_api/AuthService' - +import { bgcolor, styled } from '@mui/system' +import { Container, Grid, Paper } from '@mui/material' export const LandingRoute = () => { @@ -24,15 +25,28 @@ export const LandingRoute = () => { else { console.log("Not authenticated") } - }, 50) + }, 300) }, []) return ( -
- Welcome -
- Log in to use app - -
+ + + + + +

+ D2Loadouts +

+
+ + D2Loadouts requires permission to read your Destiny 2 information + + + + +
+
+
+
) } diff --git a/src/features/auth/BungieLogin.tsx b/src/features/auth/BungieLogin.tsx index 114bf75..d13a06d 100644 --- a/src/features/auth/BungieLogin.tsx +++ b/src/features/auth/BungieLogin.tsx @@ -7,7 +7,7 @@ const BungieLogin: React.FC = () => { authenticate() } - return ( ) + return ( ) } export default BungieLogin \ No newline at end of file diff --git a/src/index.css b/src/index.css index 6119ad9..1b7a0ee 100644 --- a/src/index.css +++ b/src/index.css @@ -22,14 +22,6 @@ a:hover { color: #535bf2; } -body { - margin: 0; - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; -} - h1 { font-size: 3.2em; line-height: 1.1; diff --git a/src/lib/bungie_api/TokenService.ts b/src/lib/bungie_api/TokenService.ts index 64a34ec..81f5a72 100644 --- a/src/lib/bungie_api/TokenService.ts +++ b/src/lib/bungie_api/TokenService.ts @@ -45,7 +45,7 @@ export function regenerateTokens(): boolean { } export function generateToken(refresh: boolean, authCode=""): Tokens | null { - const REFRESH_TOKEN = getTokens()?.refreshToken + const REFRESH_TOKEN = getTokens()?.refreshToken?.value var returnToken = null let body = refresh === false ? From 37d7970e03bb606e311a04c209b6d5b799b32e23 Mon Sep 17 00:00:00 2001 From: dragoni7 Date: Tue, 25 Jun 2024 12:19:56 -0700 Subject: [PATCH 2/2] undo index.css modification --- src/app/routes/Landing.tsx | 1 - src/index.css | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/routes/Landing.tsx b/src/app/routes/Landing.tsx index f82e697..a57c10b 100644 --- a/src/app/routes/Landing.tsx +++ b/src/app/routes/Landing.tsx @@ -4,7 +4,6 @@ import React, { useEffect} from "react" import BungieLogin from '../../features/auth/BungieLogin' import { regenerateTokens } from '../../lib/bungie_api/TokenService' import { isAuthenticated } from '../../lib/bungie_api/AuthService' -import { bgcolor, styled } from '@mui/system' import { Container, Grid, Paper } from '@mui/material' export const LandingRoute = () => { diff --git a/src/index.css b/src/index.css index 1b7a0ee..6119ad9 100644 --- a/src/index.css +++ b/src/index.css @@ -22,6 +22,14 @@ a:hover { color: #535bf2; } +body { + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; +} + h1 { font-size: 3.2em; line-height: 1.1;