Skip to content

Add authorize route for MyYoast connection #12132

@herregroen

Description

@herregroen

We want to have a new admin route to get an access token for MyYoast.

This route will be called from our settings page and should do the following:

  • Ensure the current user has sufficient privileges to make the connection ( can manage_options ).
  • Ensure the OAuth client has been configured ( has both a client ID and client secret ).
  • Get the provider from the OAuth client ( see Create OAuth Client Class #12093 ).
  • Redirect to the authorization url ( $provider->getAuthorizationUrl(); ).

Test instructions:
Success:

  • Make sure the OAuth client has both a client id and secret stored.
  • Visit this route as an admin.
  • You should be redirect to yoast.com ( make sure the redirect happens, if you made up the client ID the page after the redirect is allowed to fail ).

No permissions:

  • Make sure the OAuth client has both a client id and secret stored.
  • Visit this route as an author.
  • You should be redirect to the premium page where a warning is shown that you do not have sufficient privileges.

No configuration:

  • Make sure the OAuth client does NOT have a client id and secret stored.
  • Visit this route as an admin.
  • You should be redirect to the premium page where a warning is shown that the connection to MyYoast has not yet been configured.

parent #12136
Needs #12093

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions