mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 05:17:02 +08:00
refactor(tenant): use tenant id type (#6643)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1120,11 +1120,15 @@ pub async fn create_internal_user(
|
||||
}
|
||||
})?;
|
||||
|
||||
let default_tenant_id = common_utils::consts::DEFAULT_TENANT.to_string();
|
||||
let default_tenant_id = common_utils::id_type::TenantId::try_from_string(
|
||||
common_utils::consts::DEFAULT_TENANT.to_owned(),
|
||||
)
|
||||
.change_context(UserErrors::InternalServerError)
|
||||
.attach_printable("Unable to parse default tenant id")?;
|
||||
|
||||
if state.tenant.tenant_id != default_tenant_id {
|
||||
return Err(UserErrors::ForbiddenTenantId)
|
||||
.attach_printable("Operation allowed only for the default tenant.");
|
||||
.attach_printable("Operation allowed only for the default tenant");
|
||||
}
|
||||
|
||||
let internal_merchant_id = common_utils::id_type::MerchantId::get_internal_user_merchant_id(
|
||||
|
||||
Reference in New Issue
Block a user