File tree Expand file tree Collapse file tree 4 files changed +30
-6
lines changed
Expand file tree Collapse file tree 4 files changed +30
-6
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,8 @@ public actor AuthClient {
5353 service: " supabase.gotrue.swift " ,
5454 accessGroup: nil
5555 )
56- self . encoder = encoder ?? . goTrue
57- self . decoder = decoder ?? . goTrue
56+ self . encoder = encoder ?? . auth
57+ self . decoder = decoder ?? . auth
5858 self . fetch = fetch
5959 }
6060 }
Original file line number Diff line number Diff line change 55// Created by Guilherme Souza on 14/12/23.
66//
77
8+ import Foundation
9+
810@available ( * , deprecated, renamed: " AuthClient " )
911public typealias GoTrueClient = AuthClient
1012
@@ -19,3 +21,25 @@ public typealias GoTrueMetaSecurity = AuthMetaSecurity
1921
2022@available ( * , deprecated, renamed: " AuthError " )
2123public typealias GoTrueError = AuthError
24+
25+ extension JSONEncoder {
26+ @available (
27+ * ,
28+ deprecated,
29+ message: " Access to the default JSONEncoder instance will be removed on the next major release, please use your own instance of JSONEncoder. "
30+ )
31+ public static var goTrue : JSONEncoder {
32+ auth
33+ }
34+ }
35+
36+ extension JSONDecoder {
37+ @available (
38+ * ,
39+ deprecated,
40+ message: " Access to the default JSONDecoder instance will be removed on the next major release, please use your own instance of JSONDecoder. "
41+ )
42+ public static var goTrue : JSONDecoder {
43+ auth
44+ }
45+ }
Original file line number Diff line number Diff line change @@ -38,11 +38,11 @@ extension SessionStorage {
3838 return Self (
3939 getSession: {
4040 try localStorage. retrieve ( key: " supabase.session " ) . flatMap {
41- try JSONDecoder . goTrue . decode ( StoredSession . self, from: $0)
41+ try JSONDecoder . auth . decode ( StoredSession . self, from: $0)
4242 }
4343 } ,
4444 storeSession: {
45- try localStorage. store ( key: " supabase.session " , value: JSONEncoder . goTrue . encode ( $0) )
45+ try localStorage. store ( key: " supabase.session " , value: JSONEncoder . auth . encode ( $0) )
4646 } ,
4747 deleteSession: {
4848 try localStorage. remove ( key: " supabase.session " )
Original file line number Diff line number Diff line change @@ -602,7 +602,7 @@ private let dateFormatter = { () -> ISO8601DateFormatter in
602602} ( )
603603
604604extension JSONDecoder {
605- public static let goTrue = { ( ) -> JSONDecoder in
605+ static let auth = { ( ) -> JSONDecoder in
606606 let decoder = JSONDecoder ( )
607607 decoder. keyDecodingStrategy = . convertFromSnakeCase
608608 decoder. dateDecodingStrategy = . custom { decoder in
@@ -626,7 +626,7 @@ extension JSONDecoder {
626626}
627627
628628extension JSONEncoder {
629- public static let goTrue = { ( ) -> JSONEncoder in
629+ static let auth = { ( ) -> JSONEncoder in
630630 let encoder = JSONEncoder ( )
631631 encoder. keyEncodingStrategy = . convertToSnakeCase
632632 encoder. dateEncodingStrategy = . custom { date, encoder in
You can’t perform that action at this time.
0 commit comments