Laravel AT Protocol Client (alpha & unstable)
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add scope_authorization config options

+28 -2
+28 -2
config/client.php
··· 1 1 <?php 2 2 3 + use SocialDept\AtpClient\Enums\ScopeAuthorizationFailure; 4 + use SocialDept\AtpClient\Enums\ScopeEnforcementLevel; 5 + 3 6 return [ 4 7 /* 5 8 |-------------------------------------------------------------------------- ··· 122 125 | - 'permissive': Logs a warning but attempts the request anyway 123 126 | 124 127 */ 125 - 'scope_enforcement' => \SocialDept\AtpClient\Enums\ScopeEnforcementLevel::tryFrom( 128 + 'scope_enforcement' => ScopeEnforcementLevel::tryFrom( 126 129 env('ATP_SCOPE_ENFORCEMENT', 'permissive') 127 - ) ?? \SocialDept\AtpClient\Enums\ScopeEnforcementLevel::Permissive, 130 + ) ?? ScopeEnforcementLevel::Permissive, 131 + 132 + /* 133 + |-------------------------------------------------------------------------- 134 + | Scope Authorization 135 + |-------------------------------------------------------------------------- 136 + | 137 + | Configure behavior for the AtpScope facade and atp.scope middleware. 138 + | 139 + | failure_action: What happens when a scope check fails 140 + | - 'abort': Return a 403 HTTP response 141 + | - 'redirect': Redirect to the configured URL 142 + | - 'exception': Throw ScopeAuthorizationException 143 + | 144 + | redirect_to: URL to redirect to when failure_action is 'redirect' 145 + | 146 + */ 147 + 'scope_authorization' => [ 148 + 'failure_action' => ScopeAuthorizationFailure::tryFrom( 149 + env('ATP_SCOPE_FAILURE_ACTION', 'abort') 150 + ) ?? ScopeAuthorizationFailure::Abort, 151 + 152 + 'redirect_to' => env('ATP_SCOPE_REDIRECT', '/login'), 153 + ], 128 154 ];