mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-19 07:20:59 +00:00
fix: skip password confirmation for OAuth users
OAuth users don't have passwords set, so they should not be prompted for password confirmation when performing destructive actions. This fix: - Detects OAuth users via the hasPassword() method - Skips password confirmation in modal for OAuth users - Keeps text name confirmation as the final step - Centralizes logic in helper functions for maintainability - Changes button text to "Confirm" when password step is skipped Fixes #4457 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -443,4 +443,13 @@ class User extends Authenticatable implements SendsEmail
|
||||
&& $this->email_change_code_expires_at
|
||||
&& Carbon::now()->lessThan($this->email_change_code_expires_at);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the user has a password set.
|
||||
* OAuth users are created without passwords.
|
||||
*/
|
||||
public function hasPassword(): bool
|
||||
{
|
||||
return ! empty($this->password);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user