Code Explainers

Code explainers tagged #session

php
class TwoFactorController extends Controller
{
    public function show(Request $request): View|RedirectResponse
    {

Two-factor auth challenge flow in Laravel

authentication two-factor middleware
Intermediate 10 steps
python
from flask import g, session
 
from .extensions import cache
from .models import User

Injecting the current user in Flask templates

context-processor caching authentication
Intermediate 6 steps
php
<?php
 
namespace App\Services;
 

How user impersonation works in Laravel

authentication authorization session
Intermediate 8 steps
ruby
class ApplicationController < ActionController::Base
  ALLOWED_REDIRECT_HOSTS = [nil, ENV.fetch("APP_HOST", "app.example.com")].freeze
 
  def store_return_to(location = request.fullpath)

Safe post-login redirects in Rails

open-redirect session authentication
Intermediate 9 steps