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:
@@ -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];
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user