oAuthUtils
Classes
Section titled “Classes”ValidateAuthCodeError
Section titled “ValidateAuthCodeError”Defined in: studiocms/packages/studiocms/src/oAuthUtils.ts:12^
Error class representing a failure during the validation of an authentication code.
Extends
Section titled “Extends”any
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ValidateAuthCodeError(): ValidateAuthCodeError
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Data.TaggedError('ValidateAuthCodeError')<{ message: string; provider: string;}>.constructor
Functions
Section titled “Functions”getCookie()
Section titled “getCookie()”function getCookie(context: APIContext, key: string): any
Defined in: studiocms/packages/studiocms/src/oAuthUtils.ts:40^
Retrieves the value of a cookie from the provided API context using the specified key.
Wraps the retrieval in an Effect, returning the cookie value if found, or null
if not present.
Throws an AstroError
if there is a failure during the cookie retrieval process.
Parameters
Section titled “Parameters”context
Section titled “context”APIContext
The API context containing the cookies object.
string
The name of the cookie to retrieve.
Returns
Section titled “Returns”any
An Effect that resolves to the cookie value as a string, or null
if not found.
getUrlParam()
Section titled “getUrlParam()”function getUrlParam(context: APIContext, name: string): any
Defined in: studiocms/packages/studiocms/src/oAuthUtils.ts:24^
Retrieves the value of a specified query parameter from the given API context’s URL.
Parameters
Section titled “Parameters”context
Section titled “context”APIContext
The API context containing the URL to extract the parameter from.
string
The name of the query parameter to retrieve.
Returns
Section titled “Returns”any
An Effect that resolves to the value of the query parameter, or throws an AstroError if parsing fails.