File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ const CLIENTSIDE = typeof session !== 'function'
3434 * ```
3535 * export function mijnNederlandsAuth() {
3636 * return oAuthPlugin({
37- * mongoUrl : process.env.MONGO_URL,
37+ * databaseUri : process.env.MONGO_URL,
3838 * clientID: process.env.OAUTH_CLIENT_ID,
3939 * clientSecret: process.env.OAUTH_CLIENT_SECRET,
4040 * authorizationURL: process.env.OAUTH_SERVER + '/oauth/authorize',
@@ -306,8 +306,9 @@ function oAuthPluginServer(
306306 domain : collectionConfig . auth . cookies . domain || undefined ,
307307 } )
308308
309- // Redirect to admin dashboard
310- res . redirect ( '/admin' )
309+ // Redirect to the defined path or default to the admin dashboard
310+ const userRedirectionPath = options . userRedirectionPath || '/admin'
311+ res . redirect ( userRedirectionPath )
311312 } ,
312313 } ,
313314 ] ) ,
Original file line number Diff line number Diff line change @@ -58,4 +58,6 @@ export interface oAuthPluginOptions extends StrategyOptions {
5858 /** Defaults to "sub" */
5959 name ?: string
6060 }
61+ /** Which path to redirect the authenticated user to, redirects to /admin by default */
62+ userRedirectionPath ?: string
6163}
You can’t perform that action at this time.
0 commit comments