Settings: echtes Profil via /api/auth/me (Rolle, Founder, Abo, Avatar)
Login liefert nur {token, name, is_premium}. Für Admin-/Founder-/Tier-Info
holen wir nach Login (und beim Erscheinen von MainTabView) /api/auth/me und
zeigen ein echtes Profil mit Avatar, Email, Rolle und nur dann Premium-Status,
wenn das relevant ist.
This commit is contained in:
parent
81681130e6
commit
bfd327bd40
4 changed files with 126 additions and 3 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import SwiftUI
|
||||
|
||||
struct MainTabView: View {
|
||||
@Environment(AuthSession.self) private var auth
|
||||
|
||||
var body: some View {
|
||||
TabView {
|
||||
RoutesListView()
|
||||
|
|
@ -12,5 +14,6 @@ struct MainTabView: View {
|
|||
SettingsView()
|
||||
.tabItem { Label("Mehr", systemImage: "person.crop.circle") }
|
||||
}
|
||||
.task { await auth.loadProfile() }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue