Language: TypeScript
Label: safe
CWE: CWE-285 \u2014 Improper Authorization
The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.

Code:
		session: randomUUID(),
		permission: permissions,
	}, user);

	return (res.body as misskey.entities.MiauthGenTokenResponse).token;
};