Add user feature permissions and unified account management
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import { canAccess, type FeatureAccess } from '../lib/features'
|
||||
import PageHeading from '../ui/PageHeading'
|
||||
import MonthlyRecapPreference from './MonthlyRecapPreference'
|
||||
import NewsletterPreference from './NewsletterPreference'
|
||||
@@ -9,6 +10,7 @@ import { useRouter } from 'next/navigation'
|
||||
import { authFetch, clearToken, getApiBase, getToken } from '../lib/auth'
|
||||
|
||||
type ProfileInfo = {
|
||||
features?: FeatureAccess
|
||||
username: string
|
||||
email?: string | null
|
||||
role: string
|
||||
@@ -199,7 +201,7 @@ export default function ProfilePage() {
|
||||
</div>
|
||||
</form>
|
||||
<div className="account-connected"><span className="account-connection-dot" aria-hidden="true" /><span>{user.auth_provider === 'jellyfin' ? 'Connected with your Grizzlyflix account' : user.auth_provider === 'local' ? 'Signed in with a Magent account' : 'Signed in with your media account'}</span></div>
|
||||
<MonthlyRecapPreference key={user.email || 'no-email'} />
|
||||
{canAccess(user, 'stats') && <MonthlyRecapPreference key={user.email || 'no-email'} />}
|
||||
<NewsletterPreference key={`newsletter-${user.email || 'no-email'}`} />
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user