mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-13 01:05:37 +02:00
🔄 refactor(steam): Migrate to Steam OpenID authentication and official Web API (#282)
## Description <!-- Briefly describe the purpose and scope of your changes --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for managing multiple Steam profiles per user, including a new profiles page with avatar selection and profile management. - Introduced a streamlined Steam authentication flow using a popup window, replacing the previous QR code and team-based login. - Added utilities for Steam image handling and metadata, including avatar preloading and static Steam metadata mappings. - Enhanced OpenID verification for Steam login. - Added new image-related events and expanded event handling for Steam account updates and image processing. - **Improvements** - Refactored the account structure from teams to profiles, updating related UI, context, and storage. - Updated API headers and authentication logic to use Steam IDs instead of team IDs. - Expanded game metadata with new fields for categories, franchises, and social links. - Improved library and category schemas for richer game and profile data. - Simplified and improved Steam API client methods for fetching user info, friends, and game libraries using Steam Web API. - Updated queue processing to handle individual game updates and publish image events. - Adjusted permissions and queue configurations for better message handling and dead-letter queue support. - Improved slug creation and rating estimation utilities. - **Bug Fixes** - Fixed avatar image loading to display higher quality images after initial load. - **Removals** - Removed all team, member, and credential management functionality and related database schemas. - Eliminated the QR code-based login and related UI components. - Deleted legacy team and member database tables and related code. - Removed encryption utilities and deprecated secret keys in favor of new secret management. - **Chores** - Updated dependencies and internal configuration for new features and schema changes. - Cleaned up unused code and updated database migrations for new data structures. - Adjusted import orders and removed unused imports across multiple modules. - Added new resource declarations and updated service link configurations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -9,13 +9,14 @@ import '@fontsource/geist-sans/900.css';
|
||||
import { Text } from '@nestri/www/ui/text';
|
||||
import { styled } from "@macaron-css/solid";
|
||||
import { ZeroProvider } from './providers/zero';
|
||||
import { TeamRoute } from '@nestri/www/pages/team';
|
||||
import { ProfilesRoute } from './pages/profiles';
|
||||
import { NewProfile } from '@nestri/www/pages/new';
|
||||
import { SteamRoute } from '@nestri/www/pages/steam';
|
||||
import { OpenAuthProvider } from "@openauthjs/solid";
|
||||
import { NotFound } from '@nestri/www/pages/not-found';
|
||||
import { Navigate, Route, Router } from "@solidjs/router";
|
||||
import { globalStyle, macaron$ } from "@macaron-css/core";
|
||||
import { useStorage } from '@nestri/www/providers/account';
|
||||
import { CreateTeamComponent } from '@nestri/www/pages/new';
|
||||
import { Screen as FullScreen } from '@nestri/www/ui/layout';
|
||||
import { darkClass, lightClass, theme } from '@nestri/www/ui/theme';
|
||||
import { AccountProvider, useAccount } from '@nestri/www/providers/account';
|
||||
@@ -97,7 +98,7 @@ export const App: Component = () => {
|
||||
issuer={import.meta.env.VITE_AUTH_URL}
|
||||
clientID="web"
|
||||
>
|
||||
<Root class={theme() === "light" ? lightClass : darkClass} id="styled">
|
||||
<Root class={theme() === "light" ? lightClass : darkClass}>
|
||||
<Router>
|
||||
<Route
|
||||
path="*"
|
||||
@@ -109,28 +110,28 @@ export const App: Component = () => {
|
||||
</FullScreen>
|
||||
}>
|
||||
<ZeroProvider>
|
||||
{/* props.children */}
|
||||
{props.children}
|
||||
</ZeroProvider>
|
||||
</AccountProvider>
|
||||
)}
|
||||
>
|
||||
<Route path=":teamSlug">{TeamRoute}</Route>
|
||||
<Route path="new" component={CreateTeamComponent} />
|
||||
<Route path=":steamID">{SteamRoute}</Route>
|
||||
<Route path="profiles" component={ProfilesRoute} />
|
||||
<Route path="new" component={NewProfile} />
|
||||
<Route
|
||||
path="/"
|
||||
component={() => {
|
||||
const account = useAccount();
|
||||
return (
|
||||
<Switch>
|
||||
{/**FIXME: Somehow this does not work when the user is in the "/new" page */}
|
||||
<Match when={account.current.teams.length > 0}>
|
||||
<Match when={account.current.profiles.length > 0}>
|
||||
<Navigate
|
||||
href={`/${(
|
||||
account.current.teams.find(
|
||||
(w) => w.id === storage.value.team,
|
||||
) || account.current.teams[0]
|
||||
).slug
|
||||
}`}
|
||||
account.current.profiles.find(
|
||||
(w) => w.id === storage.value.steam,
|
||||
) || account.current.profiles[0]
|
||||
).id}`}
|
||||
/>
|
||||
</Match>
|
||||
<Match when={true}>
|
||||
@@ -144,6 +145,6 @@ export const App: Component = () => {
|
||||
</Route>
|
||||
</Router>
|
||||
</Root>
|
||||
// </OpenAuthProvider>
|
||||
</OpenAuthProvider>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user