Remove admin role alias from Teams auth

This commit is contained in:
Ruslan Bakiev
2026-05-31 21:42:39 +05:00
parent 71bb2e951b
commit 0473291940

View File

@@ -24,7 +24,6 @@ export const userTypeDefs = `#graphql
phone: String
avatarId: String
isManager: Boolean
isAdmin: Boolean @deprecated(reason: "Use isManager")
activeTeamId: String
activeTeam: UserTeam
teams: [UserTeam]
@@ -63,7 +62,7 @@ export const userTypeDefs = `#graphql
code: String!
}
input AdminTotpLoginInput {
input ManagerTotpLoginInput {
phone: String!
code: String!
}
@@ -126,7 +125,7 @@ export const userTypeDefs = `#graphql
type Mutation {
requestLoginOtp(input: RequestLoginOtpInput!): AuthChallenge!
verifyLoginOtp(input: VerifyLoginOtpInput!): AuthPayload!
adminTotpLogin(input: AdminTotpLoginInput!): AuthPayload!
managerTotpLogin(input: ManagerTotpLoginInput!): AuthPayload!
logout: Boolean!
createTeam(input: CreateTeamInput!): CreateTeamResult
updateUser(userId: String!, input: UpdateUserInput!): UpdateUserResult
@@ -193,7 +192,6 @@ async function mapProfileUser(profile: Awaited<ReturnType<typeof getOrCreateProf
phone: profile.phone,
avatarId: profile.avatarId,
isManager,
isAdmin: isManager,
activeTeamId: profile.activeTeam?.uuid ?? null,
activeTeam: profile.activeTeam ? { id: profile.activeTeam.uuid, name: profile.activeTeam.name, teamType: profile.activeTeam.teamType, logtoOrgId: profile.activeTeam.logtoOrgId, createdAt: profile.activeTeam.createdAt.toISOString() } : null,
teams: memberships.map(m => ({ id: m.team.uuid, name: m.team.name, teamType: m.team.teamType, logtoOrgId: m.team.logtoOrgId, createdAt: m.team.createdAt.toISOString() })),
@@ -304,7 +302,7 @@ export const userResolvers = {
return verifyPhoneLogin(args.input.phone, args.input.code)
},
adminTotpLogin: async (_: unknown, args: { input: { phone: string; code: string } }) => {
managerTotpLogin: async (_: unknown, args: { input: { phone: string; code: string } }) => {
return verifyPhoneLogin(args.input.phone, args.input.code)
},