Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teams context on iOS has invalid teamsSiteUrl with 2024-MarT2 update #2266

Open
nbelyh opened this issue Apr 11, 2024 · 4 comments
Open

Teams context on iOS has invalid teamsSiteUrl with 2024-MarT2 update #2266

nbelyh opened this issue Apr 11, 2024 · 4 comments

Comments

@nbelyh
Copy link

nbelyh commented Apr 11, 2024

The problem started with Teams 2024 March T2 update.
On iOS, now it turned out to be NOT THE TEAMS SITE URL passed in context, but a URL to a web page on the root site.

Was (correct, also correct on all other Teams client versions, i.e. Android/Desktop/Web):
https://something.sharepoint.com/sites/TeamSite

Now (iOS, after March 2024 update):
https://something.sharepoint.com/_layout/15/sharepoint.aspx

This is causing a problem in our application, because it assumes that teamsSiteUrl contains a URL of teams site, not a page.
Would appreciate some ideas for workarounds (how do I get the team site).

In the documentation, it is also stated that the old way is correct:
https://learn.microsoft.com/en-us/javascript/api/@microsoft/teams-js/microsoftteams.context?view=msteams-client-js-1.13.1#@microsoft-teams-js-microsoftteams-context-teamsiteurl

image

This property should not be some a page on a root site, this should be a team site url.

@nbelyh nbelyh changed the title SharePoint Application authorization fails with iOS Client 2024-MarT2 update Teams context on iOS has invalid teamsSiteUrl with 2024-MarT2 update Apr 11, 2024
@Prasad-MSFT
Copy link

@nbelyh - Thanks for raising your issue. We will check this at our end and will update you accordingly.

@Prasad-MSFT
Copy link

@nbelyh - Just to be sure, are you testing using @microsoft/teams-js": "^1.13.1 or Teams JSv2?

In Teams JSv2 it is referred as sharepointSite.url

@nbelyh
Copy link
Author

nbelyh commented Apr 15, 2024

@Prasad-MSFT
1.13.1 (our app is still on 1.x branch). But I don't think there is difference, as it's only on iOS.

As a temporary workaround, we used this:

    if (context.teamSiteUrl.endsWith('.aspx')) {
      const origin = UrlService.getOrigin(siteUrl);
      const teamSite = context.channelRelativeUrl.split('/').slice(0, 3).join('/');
      siteUrl = `${origin}${teamSite}`
    }

@Prasad-MSFT
Copy link

@nbelyh - We have raised a bug for the same. We will inform you once we get any further update from engineering team.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants