Answer the question
In order to leave comments, you need to log in
How to pull out the user in Laravel JWT if there is a token?
I use JWT Laravel https://github.com/tymondesigns/jwt-auth
public function refresh()
{
$newToken = auth()->refresh();
return response()->json([
'status' => 'ok',
'user' => [
'id' => auth()->user()->id,
'email' => auth()->user()->email,
]
]
}
Answer the question
In order to leave comments, you need to log in
$newToken = auth()->refresh();
$user = auth()->setToken($newToken)->user();
This is a Borlad VCL problem. On Delphi, the same thing (which is not strange, because the same VCL is used).
The modal window is hidden when the window is minimized/maximized. The following recipe helped me at one time: for a modal window, add the following code (code in Delphi, I think you can translate it):
type
TfrmModal = class(TForm)
private
procedure WMSYSCOMMAND(var Msg: TWMSYSCOMMAND); message WM_SYSCOMMAND;
end;
...
procedure TfrmModal.WMSYSCOMMAND(var Msg: TWMSYSCOMMAND);
begin
case (Msg.CmdType and $FFF0) of
SC_MINIMIZE:
begin
Msg.Result := 0;
EnableWindow(Application.Handle, True);
Application.Minimize;
end;
else inherited;
end;
end;
private: // of TForm1 class
void __fastcall WMSysCommand(TMessage &Msg);
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_SYSCOMMAND, TMessage, WMSysCommand)
END_MESSAGE_MAP(TForm)
void __fastcall TForm1::WMSysCommand(TMessage &Msg)
{
unsigned int const sys_code = Msg.WParam & 0xFFF0;
switch (sys_code)
{
case SC_MINIMIZE:
{
Msg.Result = 0;
EnableWindow(Application.Handle, True);
Application.Minimize();
return;
}
}
TForm::Dispatch(&Msg);
}
For example, like this: in the class of the parent window, get a member - a pointer to the modal dialog. It should be NULL by default and when closing dialogs.
In the update / draw / idle method (which you can override there), check if this member has a value. If there is, send him ToTop or whatever it is called by Borland.
More or less like this.
You can still play around with setting the main window to Enable(false) when opening a dialog, but this is already shamanism, and on another computer the behavior may be different.
You have a problem, most likely, because of the miracles of the Eight-Ten window manager, which did not figure out that the dialog is modal and it is not necessary to consider it as a separate window.
Very strange... In theory, they cannot hide, since they are modal... How do you call them? Show Modal?
But if this is the case, you can try the following actions:
1. For each window, intercept the event of hiding the modal window and display it on top of all windows
2. Do the same with a timer. Set, for example, 200 - 500 ms. Of course, to do it on a timer, this is out of hopelessness))
3. Switch to a more or less latest version of the builder
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question