Plugin Directory

Changeset 3306368


Ignore:
Timestamp:
06/04/2025 12:03:42 PM (10 months ago)
Author:
u3kkasha
Message:

fix(credential): don't make client secret dependent upon access_token

File:
1 edited

Legend:

Unmodified
Added
Removed
  • blogify-ai/trunk/core/hooks.php

    r3299707 r3306368  
    2929 */
    3030function side_effects(): void {
     31    // Initialize client secret if not exists
     32    add_option(BLOGIFY_CLIENT_SECRET_OPTION_HANDLE, generate_uuid());
    3133    register_actions_filter();
    3234    register_settings_hooks();
     
    227229                <input style='width: 80%;' type='password' id='<?php echo esc_attr(BLOGIFY_ACCESS_TOKEN_OPTION_HANDLE); ?>' name='<?php echo esc_attr(BLOGIFY_ACCESS_TOKEN_OPTION_HANDLE); ?>' name='<?php echo esc_attr(BLOGIFY_ACCESS_TOKEN_OPTION_HANDLE); ?>'
    228230                    value='<?php echo esc_attr(get_option(BLOGIFY_ACCESS_TOKEN_OPTION_HANDLE)); ?>'>
     231                <p class="description">Access Token from your Blogify account.</p>
    229232                <?php
    230233            },
     
    235238            ]
    236239        );
     240
     241        add_settings_field(
     242            'blogify_client_secret',
     243            'Blogify Client Secret',
     244            function () {
     245                $client_secret = get_option(BLOGIFY_CLIENT_SECRET_OPTION_HANDLE);
     246                ?>
     247                <input style='width: 80%;' type='text' id='blogify_client_secret' value='<?php echo esc_attr($client_secret); ?>' readonly />
     248                <p class="description">This is your Blogify Client Secret. Keep it safe and do not share it publicly.</p>
     249                <?php
     250            },
     251            'blogify',
     252            'blogify_section',
     253            [
     254                'label_for' => 'blogify_client_secret',
     255            ]
     256        );
    237257    });
    238258}
     
    244264 */
    245265function register_rest_hooks(): void {
    246     // Initialize client secret if not exists
    247     add_option(BLOGIFY_CLIENT_SECRET_OPTION_HANDLE, generate_uuid());
    248266   
    249267    // Register create post endpoint
Note: See TracChangeset for help on using the changeset viewer.