1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-16 00:24:52 +00:00

PM-20532 - Update enums to use latest best practice.

This commit is contained in:
Jared Snider
2025-05-29 11:38:59 -04:00
parent 60842c0490
commit a3ecc62907
3 changed files with 8 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
export const GrantTypes = {
export const GrantType = {
SendAccess: "send_access",
// TODO: migrate other grant types to this object
};
export type GrantType = (typeof GrantTypes)[keyof typeof GrantTypes];
export type GrantType = (typeof GrantType)[keyof typeof GrantType];

View File

@@ -1,6 +1,6 @@
export const Scopes = {
export const Scope = {
Send: "api.send",
// TODO: migrate other scopes to this object
};
export type Scope = (typeof Scopes)[keyof typeof Scopes];
export type Scope = (typeof Scope)[keyof typeof Scope];

View File

@@ -1,6 +1,6 @@
import { ClientType } from "../../../../enums";
import { GrantType, GrantTypes } from "../../../enums/grant-type.enum";
import { Scope, Scopes } from "../../../enums/scopes.enum";
import { GrantType, GrantType } from "../../../enums/grant-type.enum";
import { Scope, Scope } from "../../../enums/scopes.enum";
import { SendAccessCredentials } from "../../../send-access/abstractions/send-token.service";
export type SendAccessTokenPasswordPayload = { password: string };
@@ -38,8 +38,8 @@ export class SendAccessTokenRequest {
toIdentityTokenPayload(): SendAccessTokenPayload {
const base: SendAccessTokenPayloadBase = {
client_id: SendAccessTokenRequest.CLIENT_ID,
grant_type: GrantTypes.SendAccess,
scope: Scopes.Send,
grant_type: GrantType.SendAccess,
scope: Scope.Send,
send_id: this.sendId,
};