Skip to content

Commit

Permalink
Implement Identity services & token generation
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiyarGHD committed Nov 21, 2023
1 parent b0ac947 commit fad336a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4725,15 +4725,15 @@ public string BaseUrl

/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<MessageContract> UserHasExistsByUsernameAsync(UserHasExistsByUsernameRequestContract body)
public virtual System.Threading.Tasks.Task<UserContractMessageContract> UserHasExistsByUsernameAsync(UserHasExistsByUsernameRequestContract body)
{
return UserHasExistsByUsernameAsync(body, System.Threading.CancellationToken.None);
}

/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<MessageContract> UserHasExistsByUsernameAsync(UserHasExistsByUsernameRequestContract body, System.Threading.CancellationToken cancellationToken)
public virtual async System.Threading.Tasks.Task<UserContractMessageContract> UserHasExistsByUsernameAsync(UserHasExistsByUsernameRequestContract body, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Users/UserHasExistsByUsername");
Expand Down Expand Up @@ -4774,7 +4774,7 @@ public virtual async System.Threading.Tasks.Task<MessageContract> UserHasExistsB
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<MessageContract>(response_, headers_, cancellationToken).ConfigureAwait(false);
var objectResponse_ = await ReadObjectResponseAsync<UserContractMessageContract>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
Expand Down Expand Up @@ -4803,15 +4803,15 @@ public virtual async System.Threading.Tasks.Task<MessageContract> UserHasExistsB

/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<MessageContract> VerifyUserIdentityAsync(UserSummaryContract body)
public virtual System.Threading.Tasks.Task<UserContractMessageContract> VerifyUserIdentityAsync(UserSummaryContract body)
{
return VerifyUserIdentityAsync(body, System.Threading.CancellationToken.None);
}

/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<MessageContract> VerifyUserIdentityAsync(UserSummaryContract body, System.Threading.CancellationToken cancellationToken)
public virtual async System.Threading.Tasks.Task<UserContractMessageContract> VerifyUserIdentityAsync(UserSummaryContract body, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Users/VerifyUserIdentity");
Expand Down Expand Up @@ -4852,7 +4852,7 @@ public virtual async System.Threading.Tasks.Task<MessageContract> VerifyUserIden
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<MessageContract>(response_, headers_, cancellationToken).ConfigureAwait(false);
var objectResponse_ = await ReadObjectResponseAsync<UserContractMessageContract>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2557,17 +2557,17 @@
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/MessageContract"
"$ref": "#/components/schemas/UserContractMessageContract"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageContract"
"$ref": "#/components/schemas/UserContractMessageContract"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/MessageContract"
"$ref": "#/components/schemas/UserContractMessageContract"
}
}
}
Expand Down Expand Up @@ -2606,17 +2606,17 @@
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/MessageContract"
"$ref": "#/components/schemas/UserContractMessageContract"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/MessageContract"
"$ref": "#/components/schemas/UserContractMessageContract"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/MessageContract"
"$ref": "#/components/schemas/UserContractMessageContract"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ public UsersController(IUnitOfWork unitOfWork/*, IJWTManager jwtManager*/) : bas
}

[HttpPost]
public async Task<MessageContract> UserHasExistsByUsername(UserHasExistsByUsernameRequestContract request)
public async Task<MessageContract<UserContract>> UserHasExistsByUsername(UserHasExistsByUsernameRequestContract request)
{
return await _unitOfWork.GetContractLogic<UserEntity, AddUserRequestContract, UserContract, UserContract, long>().GetBy(x => x.UserName == request.Username);
}

[HttpPost]
public async Task<MessageContract> VerifyUserIdentity(UserSummaryContract request)
public async Task<MessageContract<UserContract>> VerifyUserIdentity(UserSummaryContract request)
{
return await _unitOfWork.GetContractLogic<UserEntity, AddUserRequestContract, UserContract, UserContract, long>().GetBy(x => x.UserName == request.UserName && x.Password == request.Password);
}
Expand Down

0 comments on commit fad336a

Please sign in to comment.