Commit e0bdfe8
fix(auth): replace trait with runtime configuration flag (#844)
* fix(auth): replace trait with runtime configuration flag
Replaces the EmitLocalSessionAsInitialSession trait with a runtime configuration flag to resolve compatibility issues with Xcode projects and align with Apple's trait guidelines.
## Changes
- Added `emitLocalSessionAsInitialSession: Bool` property to `AuthClient.Configuration`
- Defaults to `false` for backward compatibility
- Will change to `true` in next major release
- Replaced conditional compilation (`#if EmitLocalSessionAsInitialSession`) with runtime checks
- Updated deprecation warning to reference the new configuration option
- Added tests for both behaviors (old and new)
- Removed `EmitLocalSessionAsInitialSession` trait from [email protected]
## Benefits
- Works in all project types (Xcode, SPM, CocoaPods)
- No recompilation required to change behavior
- Better discoverability through autocomplete and docs
- Complies with Apple's trait guidelines (traits must be strictly additive)
## Migration
Users who want the new behavior can now set:
```swift
AuthClient(
// ... other config
emitLocalSessionAsInitialSession: true
)
```
Resolves compatibility issues where Xcode projects cannot enable package traits.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* fix(auth): add emitLocalSessionAsInitialSession to SupabaseClientOptions
Adds support for the emitLocalSessionAsInitialSession flag in SupabaseClientOptions.AuthOptions so users can configure this behavior when creating a SupabaseClient.
- Added emitLocalSessionAsInitialSession property to SupabaseClientOptions.AuthOptions
- Updated both initializers to include the new parameter
- Pass the flag through to AuthClient initialization in SupabaseClient
This ensures users can configure the flag whether they create an AuthClient directly or use SupabaseClient.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>1 parent a83512b commit e0bdfe8
File tree
6 files changed
+108
-236
lines changed- Sources
- Auth
- Supabase
- Tests/AuthTests
6 files changed
+108
-236
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1393 | 1393 | | |
1394 | 1394 | | |
1395 | 1395 | | |
1396 | | - | |
| 1396 | + | |
1397 | 1397 | | |
1398 | 1398 | | |
1399 | 1399 | | |
| |||
1407 | 1407 | | |
1408 | 1408 | | |
1409 | 1409 | | |
1410 | | - | |
| 1410 | + | |
1411 | 1411 | | |
1412 | 1412 | | |
1413 | 1413 | | |
| |||
1417 | 1417 | | |
1418 | 1418 | | |
1419 | 1419 | | |
1420 | | - | |
1421 | | - | |
| 1420 | + | |
| 1421 | + | |
1422 | 1422 | | |
1423 | 1423 | | |
1424 | 1424 | | |
1425 | 1425 | | |
1426 | 1426 | | |
1427 | 1427 | | |
1428 | 1428 | | |
1429 | | - | |
| 1429 | + | |
1430 | 1430 | | |
1431 | 1431 | | |
1432 | 1432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
49 | 59 | | |
50 | 60 | | |
51 | 61 | | |
| |||
60 | 70 | | |
61 | 71 | | |
62 | 72 | | |
| 73 | + | |
63 | 74 | | |
64 | 75 | | |
65 | 76 | | |
| |||
71 | 82 | | |
72 | 83 | | |
73 | 84 | | |
74 | | - | |
| 85 | + | |
| 86 | + | |
75 | 87 | | |
76 | 88 | | |
77 | 89 | | |
| |||
86 | 98 | | |
87 | 99 | | |
88 | 100 | | |
| 101 | + | |
89 | 102 | | |
90 | 103 | | |
91 | 104 | | |
| |||
103 | 116 | | |
104 | 117 | | |
105 | 118 | | |
| 119 | + | |
106 | 120 | | |
107 | 121 | | |
108 | 122 | | |
| |||
114 | 128 | | |
115 | 129 | | |
116 | 130 | | |
117 | | - | |
| 131 | + | |
| 132 | + | |
118 | 133 | | |
119 | 134 | | |
120 | 135 | | |
| |||
128 | 143 | | |
129 | 144 | | |
130 | 145 | | |
131 | | - | |
| 146 | + | |
| 147 | + | |
132 | 148 | | |
133 | 149 | | |
134 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
| 185 | + | |
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
| |||
71 | 78 | | |
72 | 79 | | |
73 | 80 | | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| |||
80 | 88 | | |
81 | 89 | | |
82 | 90 | | |
| 91 | + | |
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
| |||
173 | 182 | | |
174 | 183 | | |
175 | 184 | | |
| 185 | + | |
176 | 186 | | |
177 | 187 | | |
178 | 188 | | |
| |||
183 | 193 | | |
184 | 194 | | |
185 | 195 | | |
| 196 | + | |
186 | 197 | | |
187 | 198 | | |
188 | 199 | | |
| |||
0 commit comments