Best way to send a logout

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Best way to send a logout

decorior
I have the following situation

I make a REST call and I detect if the use session is till valid.

if the session is not valid I want to return the status  and then end the execution of any more lasso code

That is I want to do:

json_serialize(map(`login_status` = false))
abort

I want to wrap this into a simple method e.g. checkSession()

What is the best way to return a value and then end the execution of any more lasso code without wrapping it in a conditional statement?



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Best way to send a logout

Ke Carlton-3
not #valid ? return json_serialize(map(`login_status` = false))




On Thu, Feb 11, 2016 at 2:45 PM deco rior <[hidden email]> wrote:

> I have the following situation
>
> I make a REST call and I detect if the use session is till valid.
>
> if the session is not valid I want to return the status  and then end the
> execution of any more lasso code
>
> That is I want to do:
>
> json_serialize(map(`login_status` = false))
> abort
>
> I want to wrap this into a simple method e.g. checkSession()
>
> What is the best way to return a value and then end the execution of any
> more lasso code without wrapping it in a conditional statement?
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Best way to send a logout

decorior
But anything lasso code after the return will get executed?

I am trying to stop execution after this gets returned but outside the method

Deco



> On Feb 10, 2016, at 7:25 PM, Ke Carlton <[hidden email]> wrote:
>
> not #valid ? return json_serialize(map(`login_status` = false))
>
>
>
>
> On Thu, Feb 11, 2016 at 2:45 PM deco rior <[hidden email]> wrote:
>
>> I have the following situation
>>
>> I make a REST call and I detect if the use session is till valid.
>>
>> if the session is not valid I want to return the status  and then end the
>> execution of any more lasso code
>>
>> That is I want to do:
>>
>> json_serialize(map(`login_status` = false))
>> abort
>>
>> I want to wrap this into a simple method e.g. checkSession()
>>
>> What is the best way to return a value and then end the execution of any
>> more lasso code without wrapping it in a conditional statement?
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Best way to send a logout

Ke Carlton-3
Ideally all your REST requests should be handled by the same wrapper /
method.

That either returns the desired response or a not authorised response —
both JSON encoded.

Ke


On Fri, Feb 12, 2016 at 10:06 AM deco rior <[hidden email]>
wrote:

> But anything lasso code after the return will get executed?
>
> I am trying to stop execution after this gets returned but outside the
> method
>
> Deco
>
>
>
> > On Feb 10, 2016, at 7:25 PM, Ke Carlton <[hidden email]> wrote:
> >
> > not #valid ? return json_serialize(map(`login_status` = false))
> >
> >
> >
> >
> > On Thu, Feb 11, 2016 at 2:45 PM deco rior <[hidden email]>
> wrote:
> >
> >> I have the following situation
> >>
> >> I make a REST call and I detect if the use session is till valid.
> >>
> >> if the session is not valid I want to return the status  and then end
> the
> >> execution of any more lasso code
> >>
> >> That is I want to do:
> >>
> >> json_serialize(map(`login_status` = false))
> >> abort
> >>
> >> I want to wrap this into a simple method e.g. checkSession()
> >>
> >> What is the best way to return a value and then end the execution of any
> >> more lasso code without wrapping it in a conditional statement?
> >>
> >>
> >>
> >> #############################################################
> >>
> >> This message is sent to you because you are subscribed to
> >>  the mailing list Lasso [hidden email]
> >> Official list archives available at http://www.lassotalk.com
> >> To unsubscribe, E-mail to: <[hidden email]>
> >> Send administrative queries to  <[hidden email]>
> >>
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> >  the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Best way to send a logout

Jolle Carlestam-2
11 feb 2016 kl. 22:10 skrev Ke Carlton <[hidden email]>:
>
> Ideally all your REST requests should be handled by the same wrapper /
> method.
>
> That either returns the desired response or a not authorised response —
> both JSON encoded.

That’s how I do it.

HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Best way to send a logout

Marc Vos-3
Me too. I return a 401 or 404.

- -
Marc

> Op 12 feb. 2016 om 08:29 heeft Jolle Carlestam <[hidden email]> het volgende geschreven:
>
>> 11 feb 2016 kl. 22:10 skrev Ke Carlton <[hidden email]>:
>>
>> Ideally all your REST requests should be handled by the same wrapper /
>> method.
>>
>> That either returns the desired response or a not authorised response —
>> both JSON encoded.
>
> That’s how I do it.
>
> HDB
> Jolle
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>