File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -921,7 +921,7 @@ public final class AuthClient: Sendable {
921
921
922
922
/// Updates user data, if there is a logged in user.
923
923
@discardableResult
924
- public func update( user: UserAttributes ) async throws -> User {
924
+ public func update( user: UserAttributes , redirectTo : URL ? = nil ) async throws -> User {
925
925
var user = user
926
926
927
927
if user. email != nil {
@@ -935,6 +935,12 @@ public final class AuthClient: Sendable {
935
935
. init(
936
936
url: configuration. url. appendingPathComponent ( " user " ) ,
937
937
method: . put,
938
+ query: [
939
+ ( redirectTo ?? configuration. redirectToURL) . map { URLQueryItem (
940
+ name: " redirect_to " ,
941
+ value: $0. absoluteString
942
+ ) } ,
943
+ ] . compactMap { $0 } ,
938
944
body: configuration. encoder. encode ( user)
939
945
)
940
946
) . decoded ( as: User . self, decoder: configuration. decoder)
You can’t perform that action at this time.
0 commit comments