Click here to Skip to main content
14,662,169 members
Home » Discussions » ASP.NET
   

ASP.NET

 
Questionpls help Pin
Member 148797912-Jul-20 21:44
MemberMember 148797912-Jul-20 21:44 
SuggestionRe: pls help Pin
Richard MacCutchan2-Jul-20 21:48
mveRichard MacCutchan2-Jul-20 21:48 
GeneralRe: pls help Pin
ZurdoDev6-Jul-20 8:10
mveZurdoDev6-Jul-20 8:10 
AnswerRe: pls help Pin
David Mujica6-Jul-20 7:27
MemberDavid Mujica6-Jul-20 7:27 
JokeRe: pls help Pin
DerekT-P7-Jul-20 2:18
professionalDerekT-P7-Jul-20 2:18 
QuestionAngular service error http 400 using .Net core api to accept json, escaped quotes crashing api Pin
jkirkerx29-Jun-20 12:48
professionaljkirkerx29-Jun-20 12:48 
AnswerRe: Angular service error http 400 using .Net core api to accept json, escaped quotes crashing api Pin
Richard Deeming29-Jun-20 23:42
mveRichard Deeming29-Jun-20 23:42 
GeneralRe: Angular service error http 400 using .Net core api to accept json, escaped quotes crashing api Pin
jkirkerx30-Jun-20 6:06
professionaljkirkerx30-Jun-20 6:06 
Your spot on!
That was the issue. Double stringify.

But after thinking about it last night, and realizing the double stringify, I think I'll keep the replace function. So I put it back to my example. After testing without, seems to be more reliable with it. Weird, I create the model before I send the post. And I'm leaving the .Net side as is.
signIn(): Observable<boolean> {

    let subject = new Subject<boolean>();
    this.auth2.signIn().then(user => {
      const profile = user.getBasicProfile(),
        auth = user.getAuthResponse(),
        token = localStorage.getItem("authToken");

      let gU = new SignIn();
      gU.Id = profile.getId();
      gU.FirstName = profile.getGivenName();
      gU.LastName = profile.getFamilyName();
      gU.AccountName = profile.getEmail();
      gU.Password = "2LsdFDdsfb5Ejr";
      gU.Token = token !== null ? token : "";
      gU.Role = "Account";
      gU.ExpiresAt = new Date(auth.expires_at);
      gU.IdpId = "google";
      gU.RememberMe = true;
      gU.Avatar = new Avatar();
      gU.Avatar.Url = profile.getImageUrl();

      this.validateTokenAsPromise(gU)        
        .then(user => {
          this.zone.run(() => {            
          if (user) {
            localStorage.setItem("Account", JSON.stringify(user, null, "\t"));
            if (user.Token) {
              localStorage.setItem("authToken", user.Token);
            }            
            this.user$.next(user);
            this.isLoggedIn$.next(true);
            this.auth2SignedIn.emit(true);
            subject.next(true);
          } else {
            this.isLoggedIn$.next(false);
            this.auth2SignedIn.emit(false);
            subject.next(false);
          }
        });
      },
      (err) => {
        console.error("GAuth2 Service Error", err);
        this.isLoggedIn$.next(false);
        this.auth2SignedIn.emit(false);
        subject.next(false);
      });
    });
    return subject.asObservable();
  }
If it ain't broke don't fix it
Discover my world at jkirkerx.com

Questionerror server Pin
Member 1265427722-Jun-20 2:37
MemberMember 1265427722-Jun-20 2:37 
AnswerRe: error server Pin
ZurdoDev22-Jun-20 2:44
mveZurdoDev22-Jun-20 2:44 
AnswerRe: error server Pin
Richard Deeming22-Jun-20 5:19
mveRichard Deeming22-Jun-20 5:19 
GeneralRe: error server Pin
Member 1265427722-Jun-20 23:37
MemberMember 1265427722-Jun-20 23:37 
AnswerRe: error server Pin
Member 1265427722-Jun-20 23:41
MemberMember 1265427722-Jun-20 23:41 
AnswerRe: error server Pin
OriginalGriff22-Jun-20 23:51
mveOriginalGriff22-Jun-20 23:51 
GeneralRe: error server Pin
Member 1265427723-Jun-20 1:34
MemberMember 1265427723-Jun-20 1:34 
AnswerRe: error server Pin
OriginalGriff22-Jun-20 23:43
mveOriginalGriff22-Jun-20 23:43 
QuestionAnother NetCore question Pin
pkfox31-May-20 4:58
professionalpkfox31-May-20 4:58 
AnswerRe: Another NetCore question Pin
Mycroft Holmes31-May-20 12:22
professionalMycroft Holmes31-May-20 12:22 
GeneralRe: Another NetCore question Pin
pkfox1-Jun-20 1:58
professionalpkfox1-Jun-20 1:58 
GeneralRe: Another NetCore question Pin
Mycroft Holmes1-Jun-20 12:44
professionalMycroft Holmes1-Jun-20 12:44 
AnswerRe: Another NetCore question Pin
Richard Deeming1-Jun-20 3:31
mveRichard Deeming1-Jun-20 3:31 
GeneralRe: Another NetCore question Pin
pkfox1-Jun-20 4:08
professionalpkfox1-Jun-20 4:08 
AnswerRe: Another NetCore question Pin
jkirkerx1-Jun-20 13:47
professionaljkirkerx1-Jun-20 13:47 
GeneralRe: Another NetCore question Pin
pkfox4-Jun-20 10:54
professionalpkfox4-Jun-20 10:54 
QuestionCheckboxList Styling Problem Pin
feelblue8730-May-20 6:14
Memberfeelblue8730-May-20 6:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.