# Are User API Keys Not Generated When Logging in via Login Link?

**URL:** https://meta.discourse.org/t/are-user-api-keys-not-generated-when-logging-in-via-login-link/328169
**Category:** Development
**Created:** [September 26, 2024, 4:53am UTC](https://meta.discourse.org/t/are-user-api-keys-not-generated-when-logging-in-via-login-link/328169 "2024-09-26T04:53:22Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![wings](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wings/32/331381_2.png) [@wings](https://meta.discourse.org/u/wings)
#### Post date: [September 26, 2024, 4:53am UTC](https://meta.discourse.org/t/are-user-api-keys-not-generated-when-logging-in-via-login-link/328169/1 "2024-09-26T04:53:22Z")

</div>

Hi, I have a question about the flow described in this topic: [User API keys specification](https://meta.discourse.org/t/user-api-keys-specification/48536) regarding how to use user API keys.

As mentioned in the post:

> [@User API keys specification](https://meta.discourse.org/t/user-api-keys-specification/48536/1):
>
> After `/user-api-key/new` is called with correct params 2 things may happen
> 
> 1. If user is not logged on, we will redirect to login (after login we will resume authorization)
> 2. Once a user is logged on they will be presented with the authorization UI

The flow says that if a user is not logged in and after being redirected to `/user-api-key/new`, they will be redirected to the login UI. After logging in with a password, the user is correctly redirected to the authorization UI. However, when using the “Login with Link” method, after opening the login link from the email, the user is only redirected to a confirmation page to complete the login and then sent to the home page, without being redirected to the authorization UI for the user API key.

My question is: Is this the expected behavior, where a user cannot generate a user API key when logging in via the “Login with Link” method? Or is there an additional setup required to ensure the user is redirected to generate the API key after logging in with the link?
