Skip to content

Support theme while redirecting user to authorization URL #1129

@sagar7993

Description

@sagar7993

Can we allow support for rendering theme while creating the authorization URL? Right now I have to manually set it as light/dark in the WorkOS dashboard. But I would love to have the capability to set the theme while constructing the authorization URL. Here's what I am proposing

const authorizationUrl = workos.userManagement.getAuthorizationUrl({
    provider: 'authkit',
    screenHint: 'sign-in',
    redirectUri: `<REDIRECT_URL>`,
    clientId: <WORKOS_CLIENT_ID>,
    state: redirectUrl,
    // Add new option called `theme`
    theme: 'dark' // Possible values are `light` or `dark` or `system` or `undefined`
});
redirect(authorizationUrl);

This will allow me to keep my login page in sync with the user's theme choice on my own dashboard. If user has selected dark mode on my dashboard, I would like to be able to send them to a dark themed login page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions