mirror of
https://github.com/discourse/discourse.git
synced 2025-03-14 10:33:43 +00:00
DEV: Add code comments around oauth user-api-key/new
handling (#31774)
Followup to #31759
This commit is contained in:
@ -87,6 +87,9 @@ class Users::OmniauthCallbacksController < ApplicationController
|
||||
cookies["_bypass_cache"] = true
|
||||
cookies[:authentication_data] = { value: client_hash.to_json, path: Discourse.base_path("/") }
|
||||
|
||||
# If the user account doesn't already exist, and this signup is part of a user-api-key request, direct
|
||||
# the user to the homepage first so that signup can be completed. They'll be redirected to the user-api-key
|
||||
# route once signup is complete. Hopefully, this can be simplified once fullscreen login/signup is everywhere.
|
||||
if !current_user && @origin.start_with?("/user-api-key/new")
|
||||
redirect_to path("/")
|
||||
else
|
||||
|
@ -124,7 +124,8 @@ class Auth::Result
|
||||
AssociatedGroup.where(id: associated_group_ids).update_all("last_used = CURRENT_TIMESTAMP")
|
||||
end
|
||||
|
||||
Group.user_trust_level_change!(user.id, user.trust_level) if user && !user.staged
|
||||
# refreshes automatic group membership (despite the name, it doesn't change TLs)
|
||||
Group.user_trust_level_change!(user.id, user.trust_level) if user
|
||||
end
|
||||
|
||||
def can_edit_name
|
||||
|
Reference in New Issue
Block a user