Skip to content

Commit

Permalink
Deprecate methods related to updating user attributes using the Manag…
Browse files Browse the repository at this point in the history
…ement API (#815)
  • Loading branch information
Widcket committed Dec 18, 2023
1 parent 3153dcb commit 2af7055
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Auth0/UserPatchAttributes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ final public class UserPatchAttributes {
- Parameter blocked: If the user is blocked.
- Returns: The same `UserPatchAttributes` instance to allow method chaining.
*/
@available(*, deprecated, message: "This attribute can no longer be updated from native apps for security reasons")
public func blocked(_ blocked: Bool) -> UserPatchAttributes {
dictionary["blocked"] = blocked
return self
Expand All @@ -36,6 +37,7 @@ final public class UserPatchAttributes {
- clientId: Auth0 Client ID.
- Returns: The same `UserPatchAttributes` instance to allow method chaining.
*/
@available(*, deprecated, message: "This attribute can no longer be updated from native apps for security reasons")
public func email(_ email: String, verified: Bool? = nil, verify: Bool? = nil, connection: String, clientId: String) -> UserPatchAttributes {
dictionary["email"] = email
dictionary["verify_email"] = verify
Expand All @@ -53,6 +55,7 @@ final public class UserPatchAttributes {
- connection: Name of the connection.
- Returns: The same `UserPatchAttributes` instance to allow method chaining.
*/
@available(*, deprecated, message: "This attribute can no longer be updated from native apps for security reasons")
public func emailVerified(_ verified: Bool, connection: String) -> UserPatchAttributes {
dictionary["email_verified"] = verified
dictionary["connection"] = connection
Expand All @@ -70,6 +73,7 @@ final public class UserPatchAttributes {
- clientId: Auth0 Client ID.
- Returns: The same `UserPatchAttributes` instance to allow method chaining.
*/
@available(*, deprecated, message: "This attribute can no longer be updated from native apps for security reasons")
public func phoneNumber(_ phoneNumber: String, verified: Bool? = nil, verify: Bool? = nil, connection: String, clientId: String) -> UserPatchAttributes {
dictionary["phone_number"] = phoneNumber
dictionary["verify_phone_number"] = verify
Expand All @@ -87,6 +91,7 @@ final public class UserPatchAttributes {
- connection: Name of the connection.
- Returns: The same `UserPatchAttributes` instance to allow method chaining.
*/
@available(*, deprecated, message: "This attribute can no longer be updated from native apps for security reasons")
public func phoneVerified(_ verified: Bool, connection: String) -> UserPatchAttributes {
dictionary["phone_verified"] = verified
dictionary["connection"] = connection
Expand All @@ -102,6 +107,7 @@ final public class UserPatchAttributes {
- connection: Name of the connection.
- Returns: The same `UserPatchAttributes` instance to allow method chaining.
*/
@available(*, deprecated, message: "This attribute can no longer be updated from native apps for security reasons")
public func password(_ password: String, verify: Bool? = nil, connection: String) -> UserPatchAttributes {
dictionary["password"] = password
dictionary["connection"] = connection
Expand All @@ -117,6 +123,7 @@ final public class UserPatchAttributes {
- connection: Name of the connection.
- Returns: The same `UserPatchAttributes` instance to allow method chaining.
*/
@available(*, deprecated, message: "This attribute can no longer be updated from native apps for security reasons")
public func username(_ username: String, connection: String) -> UserPatchAttributes {
dictionary["username"] = username
dictionary["connection"] = connection
Expand All @@ -140,6 +147,7 @@ final public class UserPatchAttributes {
- Parameter metadata: New app metadata values.
- Returns: The same `UserPatchAttributes` instance to allow method chaining.
*/
@available(*, deprecated, message: "This attribute can no longer be updated from native apps for security reasons")
public func appMetadata(_ metadata: [String: Any]) -> UserPatchAttributes {
dictionary["app_metadata"] = metadata
return self
Expand Down
3 changes: 2 additions & 1 deletion Auth0/Users.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public protocol Users: Trackable, Loggable {
- ``UserPatchAttributes``
- [Management API Endpoint](https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id)
*/
@available(*, deprecated, message: "This operation can no longer be performed from native apps for security reasons")
func patch(_ identifier: String, attributes: UserPatchAttributes) -> Request<ManagementObject, ManagementError>

/**
Expand All @@ -142,7 +143,7 @@ public protocol Users: Trackable, Loggable {
- identifier: ID of the user to update. You can get this value from the `sub` claim of the user's ID token, or from the `sub` property of a ``UserInfo`` instance.
- userMetadata: Metadata to update.
- Returns: A request that will yield the updated user.
- Requires: The token must have one of the following scopes: `update:users`, `update:users_app_metadata`.
- Requires: The token must have the `update:current_user_metadata` scope.
## See Also
Expand Down

0 comments on commit 2af7055

Please sign in to comment.