AOSSIE-Org / AOSSIE-Org/Resonate

AuthStateController calls account.get() on init causing 401 for guest users

オープン
#746 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Dart
スター
344
フォーク
350
PR マージ指標
30日以内にマージされた PR はありません

説明

### 🐛 Describe the bug

### Bug
AuthStateController.onInit() unconditionally calls setUserProfileData(), which internally calls account.get().

When the user is not logged in, this results in:
401 general_unauthorized_scope (guest missing account scope)

### Steps to Reproduce
1. Launch app as a logged-out user
2. AuthStateController initializes
3. account.get() is called
4. Appwrite throws 401

### Expected Behavior
account.get() should only be called when a valid session exists.

### Actual Behavior
account.get() is called for guest users, causing auth failure.

### Fix
Guard setUserProfileData() with a login/session check:
```dart
if (await getLoginState) {
await setUserProfileData();
}

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。