You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -86,6 +86,69 @@ This will be your callback url (host is determined by `window.location.origin`):
86
86
87
87
That's it! You can now use @bitinflow/nuxt-oauth in your Nuxt app ✨
88
88
89
+
## Module Options
90
+
91
+
The module provides a set of customizable options to configure OAuth-based authentication for your application. Below is a detailed description of each option and its default values:
92
+
93
+
### `redirect`
94
+
95
+
This option defines the URLs for redirection during the authentication process.
96
+
97
+
-`login` (`string`): The URL to redirect to when a user needs to log in. Default: `/login`.
98
+
-`logout` (`string`): The URL to redirect to after logging out. Default: `/`.
99
+
-`callback` (`string`): The URL to handle the OAuth callback. Default: `/login`.
100
+
-`home` (`string`): The URL to redirect to after successful authentication. Default: `/`.
101
+
102
+
### `endpoints`
103
+
104
+
Configures the OAuth server endpoints for authorization, token exchange, and user information retrieval.
105
+
106
+
-`authorization` (`string`): The OAuth authorization endpoint. Default: `https://example.com/oauth/authorize`.
107
+
-`token` (`string`): The OAuth token endpoint. Default: `https://example.com/oauth/token`.
108
+
-`userInfo` (`string`): The endpoint to retrieve user information. Default: `https://example.com/api/users/me`.
109
+
-`logout` (`string | null`): The endpoint for logging out from the OAuth provider. Default: `null`.
110
+
111
+
### `refreshToken`
112
+
113
+
Manages the refresh token settings.
114
+
115
+
-`maxAge` (`number`): The maximum age (in seconds) for storing the refresh token in cookies. Default: `60 * 60 * 24 * 30` (30 days).
116
+
117
+
### `cookies`
118
+
119
+
Configures cookie settings for storing OAuth tokens and related data.
120
+
121
+
-`prefix` (`string`): A prefix for all cookie names. Default: none.
122
+
-`names`: Specific names for different OAuth-related cookies.
123
+
-`oauth_user`: The cookie name for storing the OAuth user. Default: `oauth_user`.
124
+
-`oauth_state`: The cookie name for storing the OAuth state. Default: `oauth_state`.
125
+
-`oauth_code_verifier`: The cookie name for storing the OAuth code verifier. Default: `oauth_code_verifier`.
126
+
-`oauth_access_token`: The cookie name for storing the access token. Default: `oauth_access_token`.
127
+
-`oauth_refresh_token`: The cookie name for storing the refresh token. Default: `oauth_refresh_token`.
128
+
-`options`: Additional settings for cookie behavior.
129
+
-`path` (`string`): The cookie path. Default: none.
130
+
-`maxAge` (`number`): The cookie's maximum age (in seconds). Default: none.
131
+
-`secure` (`boolean`): Whether the cookie should only be sent over HTTPS. Default: none.
132
+
-`sameSite` (`string`): Sets the `SameSite` cookie attribute (`lax`, `strict`, or `none`). Default: none.
133
+
-`domain` (`string`): Specifies the cookie's domain. Default: none.
134
+
-`httpOnly` (`boolean`): Indicates if the cookie is inaccessible to JavaScript. Default: none.
135
+
136
+
### `clientId`
137
+
138
+
- (`string`): The client ID used for OAuth authentication. Default: `please-set-client-id`.
139
+
140
+
### `responseType`
141
+
142
+
- (`'token' | 'code'`): The type of OAuth response, either token-based or code-based flow. Default: `code`.
143
+
144
+
### `prompt`
145
+
146
+
- (`'' | 'none' | 'login' | 'consent'`): The prompt parameter to control the OAuth flow. Default: `''`.
147
+
148
+
### `scope`
149
+
150
+
- (`string[]`): The OAuth scopes requested during authentication. Default: `[]` (empty array).
0 commit comments