File tree 1 file changed +8
-10
lines changed
1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: data:: models:: { Organization , RedisPool , StripePlan , UserRole } ;
2
- use crate :: data:: schema:: user_organizations;
3
2
use crate :: get_env;
4
3
use crate :: operators:: invitation_operator:: check_inv_valid;
5
4
use crate :: operators:: organization_operator:: { get_org_from_id_query, get_user_org_count} ;
@@ -546,17 +545,16 @@ pub async fn callback(
546
545
// Use the new_user_redirect_uri if the user has just been created and is the owner of
547
546
// one organization
548
547
let mut final_redirect = login_state. redirect_uri . clone ( ) ;
549
- if user_is_new {
550
- if user_orgs
548
+ if user_is_new
549
+ && user_orgs
551
550
. clone ( )
552
551
. into_iter ( )
553
- . any ( |org_user| return org_user. role == 2 )
554
- && user_orgs. len ( ) == 1
555
- {
556
- final_redirect = login_state
557
- . new_user_redirect_uri
558
- . unwrap_or ( login_state. redirect_uri ) ;
559
- }
552
+ . any ( |org_user| org_user. role == 2 )
553
+ && user_orgs. len ( ) == 1
554
+ {
555
+ final_redirect = login_state
556
+ . new_user_redirect_uri
557
+ . unwrap_or ( login_state. redirect_uri ) ;
560
558
}
561
559
562
560
Ok ( HttpResponse :: SeeOther ( )
You can’t perform that action at this time.
0 commit comments