-
Notifications
You must be signed in to change notification settings - Fork 808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.x] Inertia.js: Add support for all Jetstream-provided views. #298
[2.x] Inertia.js: Add support for all Jetstream-provided views. #298
Conversation
@taylorotwell For what it's worth, I definitely think this is the right approach to go. The best Inertia.js experience is to do your whole app with Vue based page components. Session expiration "just works" this way, since users are automatically redirected back to the login page, which itself is an Inertia endpoint. I don't think I'd ever, personally, build an app that had a mix of Blade views and Vue page components. That said, this does create an extra maintenance burden on this project, since these auth views can no longer be shared between the two stacks. I feel like that's a worthwhile tradeoff though. 🤷♂️ That all said, the session expiration issue could be solved using an @claudiodekker Excellent work brother, this looks great. 🙌 |
Thanks! 👍 On a side-note (just so that I don't forget), Once laravel/fortify#107 gets tagged, I can remove the |
Yup, and while we're creating todo lists, it would be great to get |
@claudiodekker I've just tagged a new laravel/fortify release. |
This is no longer necessary as of Fortify 1.6.1
@taylorotwell Thanks! I've updated the PR. I also updated the |
Since 'filled' is used in the back-end, using remember: false will cause remember to pass.
@@ -0,0 +1,8 @@ | |||
<template> | |||
<a href="/"> | |||
<svg class="w-16 h-16" viewBox="0 0 48 48" fill="none" xmlns="http:https://www.w3.org/2000/svg"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we just reuse the ApplicationMark
component here instead of duplicating?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I looked at that, but it's different, and because I'm trying to replicate the other views to keep branding consistent I copied this one instead.
# Conflicts: # CHANGELOG.md
@claudiodekker Does this need to be rebased or something? It seems to contain some random other commits? |
@taylorotwell Yeah, I merged |
I've merged 1.x into master. |
@taylorotwell Fixed, thanks! 👍 |
Sick. Will probably review and get this merged in tomorrow. |
Cool, let me know if there's anything else you need me to do 👍 |
@claudiodekker One bug I've noticed so far... on two-factor code entry screen after login... entering the code and then hitting "enter" just toggles you to recovery code form instead of submitting auth code. |
Oof, yeah, that shouldn't happen. I'll look at it in a bit, and will also double check the keyboard behavior of other forms. |
That was the only thing I hit so far. I think I've tested every form. |
Great, thanks for letting me know! 🙏 Having dinner right now, so it might take an hour or so before I have a fix. Want me to ping you when it's done? |
I think I'l have it fixed. Don't worry about it. |
}, | ||
methods: { | ||
toggleRecovery() { | ||
this.recovery ^= true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.recovery ^= true | |
this.recovery = ! this.recovery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are using this to toggle between 0 and 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be less confusing to use a boolean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually correct. It's a bitwise XOR that changes true to false, and false to true in this situation (hence toggle) 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually a neat trick!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure 🙂 Also works in PHP, or any other C-based language for that matter AFAIK 👌
</div> | ||
|
||
<div class="flex items-center justify-end mt-4"> | ||
<button @click.prevent="toggleRecovery" class="text-sm text-gray-600 hover:text-gray-900 underline cursor-pointer"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<button @click.prevent="toggleRecovery" class="text-sm text-gray-600 hover:text-gray-900 underline cursor-pointer"> | |
<button type="button" @click.prevent="toggleRecovery" class="text-sm text-gray-600 hover:text-gray-900 underline cursor-pointer"> |
Use an authentication code | ||
</template> | ||
</button> | ||
<jet-button class="ml-4" :class="{ 'opacity-25': form.processing }" :disabled="form.processing"> |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already the default type for jet buttons.
This PR adds Inertia variants for all Jetstream included views. This allows a more native Inertia experience for users of this stack, and solves several issues and difficulties that makes for an all-in-all smoother experience.
For example, some Jetstream users have been asking questions on our Discord regarding difficulties they're experiencing with getting Jetstream to play well with Inertia. Specifically, the most common issue is when a session expires, as the user then gets redirected to the login page, and because that login page is a Blade view, Inertia renders it in a so-called 'error modal'.
To solve or prevent this, users should instead use Inertia for their login pages as well, and while some have gotten to the point where they're attempting to (re)configure Fortify to use Inertia views instead, this too isn't the most straight-forward thing to do.